Hello Guys
The program is basically like this in a nutshell:
===================================
There is a UIViewController, it has an instance variable of NSInteger:
I declare it in the UIViewController .h file as:
Then, I synthesize it in its .m file:
The view (UIView) of this UIViewController has a method doSomething: needs to access the value of theNum.
Here is the code in this "view"'s .m file:
==============================
So how can I get the value of theNum from UIViewController to its UIView?
Thanks for advanced! And wish you guys Merry Xmas.
The program is basically like this in a nutshell:
===================================
There is a UIViewController, it has an instance variable of NSInteger:
I declare it in the UIViewController .h file as:
NSInterger *theNum;
...
@property NSInteger *theNum;
Then, I synthesize it in its .m file:
@synthesize theNum;
The view (UIView) of this UIViewController has a method doSomething: needs to access the value of theNum.
Here is the code in this "view"'s .m file:
-(void)doSomething {
NSInteger *myNum = self.superview.theNum; //error: request for member 'theNum' in something not a structure or union
// do something
}
==============================
So how can I get the value of theNum from UIViewController to its UIView?
Thanks for advanced! And wish you guys Merry Xmas.
Last edited: