Created
January 24, 2012 09:46
-
-
Save aquarius/1669307 to your computer and use it in GitHub Desktop.
UIViewController init
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil | |
{ | |
static NSString *nibName = @"MYViewController" | |
self = [super initWithNibName:nibName bundle:nibBundleOrNil]; | |
if (!self) return; | |
return self; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MYViewController *vc = [[MYViewController alloc] init]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That code is too much, IMHO. You can simply remove the whole
initWithNibName:bundle:
as your nib name is the same as your class name.-[UIViewController init]
is the same as-[UIViewController initWithNibName:nil bundle:nil]
which loads the nib with the same name as the class name. My 2ct.