Created
February 17, 2014 18:37
-
-
Save petermaurer/9056376 to your computer and use it in GitHub Desktop.
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
@implementation NSBundle (PMExtensions) | |
+ (BOOL)vintageStyleLoadNibNamed: (NSString*)theName owner: (id)theOwner { | |
#if __MAC_OS_X_VERSION_MIN_REQUIRED<__MAC_10_8 | |
return [self loadNibNamed: theName owner: theOwner]; | |
#else | |
BOOL didLoad = NO; | |
NSNib *theNib = [[NSNib alloc] initWithNibNamed: theName bundle: nil]; | |
if (theNib) { | |
NSArray *theTopLevelObjects = nil; | |
if ([theNib instantiateWithOwner: theOwner topLevelObjects: &theTopLevelObjects]) { | |
for (id aTopLevelObject in theTopLevelObjects) { | |
[aTopLevelObject retain]; | |
} | |
didLoad = YES; | |
} | |
[theNib release]; | |
} | |
return didLoad; | |
#endif | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment