Created
May 29, 2012 18:41
-
-
Save pcperini/2829951 to your computer and use it in GitHub Desktop.
Quick (NS|UI)ViewController Loading
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
// .h | |
#if !TARGET_OS_IPHONE | |
#import <Cocoa/Cocoa.h> | |
#define APPLViewController NSViewController | |
#else | |
#import <UIKit/UIKit.h> | |
#import <Foundation/Foundation.h> | |
#define APPLViewController UIViewController | |
#endif | |
@interface APPLViewController (QuickNibLoading) | |
- (id)initWithNib; | |
@end | |
// .m | |
@implementation APPLViewController (QuickNibLoading) | |
- (id)initWithNib | |
{ | |
self = [self initWithNibName: NSStringFromClass([self class]) bundle: nil]; | |
return self; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment