[英]How do I call a method present in root view controller from my second view controller?
[英]multi viewcontroller : call variable of root controller from a sub view controller
//root controller
class subviewcontroller;
@rootviewcontroller:UIViewController
{
NSInteger a;
}
在subviewcontroller super.a = 1中调用a;
系统报告:
error:Request for member ‘a' in something not a structure or union
欢迎任何评论
开发者
您需要使其成为属性并进行合成。 喜欢:
在头文件中
@property(nonatomic, assign) NSInteger a;
并在实现文件中:
@synthesize a;
希望这可以帮助。 谢谢
马杜普
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.