Created
March 23, 2015 18:55
-
-
Save brianmpalma/0eb440c53e6a941f6aee to your computer and use it in GitHub Desktop.
VC initialization
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
// no new initializers defined in the .h | |
- (instancetype)init | |
{ | |
self = [super initWithNibName:nil bundle:nil]; | |
if (self) { | |
// do stuff | |
} | |
return self; | |
} | |
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil | |
{ | |
return [self init]; | |
} | |
// initializer defined in .h | |
- (instancetype)initWithArchivedTasks:(BOOL)archivedTasks; | |
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil | |
{ | |
[NSException raise:@"Initializer Error:" format:@"Please use -initWithArchivedTasks:"]; | |
return nil; | |
} | |
- (instancetype)initWithArchivedTasks:(BOOL)archivedTasks | |
{ | |
self = [super initWithNibName:nil bundle:nil]; | |
if (self) { | |
self.archivedTasks = archivedTasks; | |
} | |
return self; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment