I have a custom subclass of UIViewController that pops into the UINavigationController stack. I want to add some of my data during initialization / click. Should I
a) write your own init method with my data as an argument, how is it?
MyCustomViewControllerSubclass.m:
- (id)initWithNibName:(NSString *)nibName bundle:(NSBundle *)bundle myCustomData:(NSData *)data{
if(self = [super initWithNibName:nibName bundle:nibName]){
}
return self;
}
or b) add a property to my view manager, which stores my user data, and then add it after initialization?
Is there any advantage / disadvantage to one of these approaches or is there another way to do this?
Very happy for the answers!
source
share