Hi guys,
I have a custom UIViewController subclass, which gets pushed on a UINavigationController stack. I want to add some data of my own at the time of initialization/pushing. Should I
a) write a custom init method with my data as argument, like this?
MyCustomViewControllerSubclass.m:
-(id) initWithNibName: bundle: myCustomData: {
if(self = [super initWithNibName: bundle:]){
//do stuff with my data
}
return self;
}
or b) add a property to my viewcontroller that stores my custom data and then add it after initialization?
Is there some advantage/disadvantage in one of these approaches or is there another way to do this?
Very happy for replies!