开发者

iPhone + access Controls from other class

开发者 https://www.devze.com 2022-12-18 15:01 出处:网络
I have classes: PropertyCalcViewController .m & .h In the .h I have IBOutlet UIButton *btnGo; @property (nonatomic, retain) IBOutlet UIButton *btnGo;

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

精彩评论

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

关注公众号