Created
March 2, 2012 17:48
-
-
Save cmkilger/1959950 to your computer and use it in GitHub Desktop.
loadView
This file contains 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
- (void)loadView { | |
if (!self.nibName) { | |
NSString * nibName = nil; | |
NSString * className = NSStringFromClass([self class]); | |
if ([className hasSuffix:@"Controller"]) | |
nibName = [className substringToIndex:[className rangeOfString:@"Controller" options:NSBackwardsSearch].location]; | |
if (!nibName || ![self.nibBundle pathForResource:nibName ofType:@"nib"]) | |
nibName = className; | |
if ([self.nibBundle pathForResource:nibName ofType:@"nib"]) { | |
[self.nibBundle loadNibNamed:nibName owner:self options:nil]; | |
return; | |
} | |
} | |
[super loadView]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment