I have a general question, I want to hide the button from another class, that class is a wrapper class to mix c++ code and objective c code. I have a function say for ex: do action{}, that function will show some buttons and hide some other button depends on input. If I call the function in same class it is working fine. However if I call from wrapper class that is not working as expected.
when a buttons clicked I tried changing the state of the button by calling function like this. It worked.
main_class.mm
- (IBAction)switchViews:(id)sender
{
[self doaction:5];
}
-(void) doaction:user_id
{
self.email_id.hidden = YES;
}
@interface interface_wrapper : NSObject
{
@public
rootViewController *root_view;
}
-(void) doaction:(long)user_id;
@end
@implementation gui_interface_wrapper
-(void) success:(long) user_id
{
// root_view is set with root controller object. So that I can access main which is having the button.
[root_view.main doaction:user_id];
}
@end However if I have not called the function in that place. And a function call is made from some wrapper class outside it is having a pointer to that object [I checked self address is same in both the calls] button goes disabled instead of hiding. Can we do GUI action from wrapper class?
Any idea? thanks in advance.