ok, go here, and download the zip
its a solution i did for a post on another thread
http://www.de-clunk.com/buttonsGalore.zip
in there, the 2 classes you want to focus on are maincontroller.h and .m and button.h and .m
in button.h, i make the class maincontroller available to button.h
@class maincontroller
and then i declare a property
maincontroller *parentLink;
and
@property(assign,nonatomic)maincontroller *parentLink;
this creates the pointer, but it only knows that its of the class maincontroller
now, in the maincontroller.m file, i say obj.parentLink = self;
so when i generate the UIView object, im telling it that i want to create a symbolic (thats what i call it anyway) link back to mainController
this means, from any uiview that is generated in maincontroller object, i can reach back and run its methods, there fore creating the link.
when you build and go in the buttonsGalore project, click one of the buttons, it traces in NSLog (look at the console) showing that a method from the mainController was run, and was called in a subview.