How can I set an property from outside an Objective C class?
I have a class called MyCtlr and in the MyCtrl.h I declared a variable called status like this:
@interface RejectController : UIViewController{
IBOutlet UICustomLabel *lblMessage;
}
@property NSInteger status;
@end
Then I want to set it in another class to a specific value like this:
MyCtrl *myCtrl = [self.storyboard instantiateViewControllerWithIdentifier:@"MyCtrlIdentify"];
[myCtrl status:2]; //here triggers the error: No visible @interface for 'MyCtrl' declares the selector 'status:'
[self.navigationController pushViewController:myCtrl animated:YES];
but as soon as I try to set a value to status I get the error: No visible @interface for 'MyCtrl' declares the selector 'status:'
Does anyone know why?