iPhone: should initWithNibName:bundle: method be deleted from UIViewController class if not used?
Posted
by Scott Pendleton
on Stack Overflow
See other posts from Stack Overflow
or by Scott Pendleton
Published on 2010-04-03T22:20:31Z
Indexed on
2010/04/03
22:23 UTC
Read the original article
Hit count: 294
I notice that this method is provided in UIViewController .m files, but is commented out:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
I had been leaving that method commented out, or even deleting it. But then I looked at this line inside the method:
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])
I assume that if it were truly important for self to be set equal to super, then Apple would not have the method be commented out by default. On the other hand, if I do need to do some customization in that method, why do I need to set self = super? What's the best practice, and why?
© Stack Overflow or respective owner