问题
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
Why we use this method? Is it necessary when using xib file?
回答1:
Why we use init with nib ?
So we can take a view created with interface builder and initialize a view from that instead of coding everything yourself.
it is a good alternative to coding everything if you just need basic things.
来源:https://stackoverflow.com/questions/15633940/when-and-why-to-use-initwithnibnamebundle-in-development