views:

43

answers:

2

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 removeFromSuperView]

How can I do this?

+1  A: 

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.

KennyTM
the_manager is the object of Manager class ?btnGo is in PropertyCalcViewController class not in Manager class..
pratik
Oh I see. Your description isn't that clear because the `@interface` is missing.
KennyTM
the_view_ctrler is the object of PropertyCalcViewController class ?
pratik
@pratik: Yes. _
KennyTM
OK, I did that but the button is not getting removed :(
pratik
@pratik: Have you changed your `@synthesize`?
KennyTM
@KennyTM: Yes I have changed it.
pratik
+1  A: 

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

Kenny