开发者

iPhone + access Controls from other class

I have classes: PropertyCalcViewController .m & .h

In the .h I have

IBOutlet UIButton *btnGo;
@property (nonatomic, retain) IBOutlet UIButton *btnGo;

and in the .m file I have

@synthesize *btnGo;

Now I also have another class Manager .m & .h.

What I want to do is that access btnGo from the Manager class and remove it from PropertyCalcViewController like

[btnGo removeFromSuper开发者_StackOverflow中文版View]

How can I do this?


To access a property, you use the "dot-syntax":

[the_view_ctrler.btnGo removeFromSuperview];

Also, I believe you mean @synthesize btnGo;, instead of @synthesize *btnGo; which is a syntax-error.


Insure that btnGo has been properly linked up in Interface Builder. Simple but common oversight.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜