One Quickie


Making BNR-Style View Controller (UIViewController->General)
One of the things I like about the Big Nerd Ranch iPhone book is how they put the name of the nib file in a ViewController's implementation, rather than making all users of the ViewController know the nib file name. Here's how they do it:
@implementation BlahViewController

- (id) init {
    if ((self = [super initWithNibName: @"BlahViewController"
                       bundle: nil])) {
        // other initialization
    }
    return self;
} // init


- (id) initWithNibName: (NSString *) nibNameOrNil
                bundle: (NSBundle *) nibBundleOrNil {
    return [self init];
} // initWithNibName



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com