Created
June 16, 2013 00:24
-
-
Save EmperiorEric/5790170 to your computer and use it in GitHub Desktop.
So I've seen both of these options from time to time, and I'm wondering if there is something inherently wrong with an option, if there is some non obvious benefit, or if it is entirely a preference based decision.
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
- (id)initWithProperty:(id)property | |
{ | |
self = [super init]; | |
if (self) { | |
self.property = property; | |
} | |
return self; | |
} | |
- (id)initWithProperty:(id)property otherProperty:(id)otherProperty | |
{ | |
self = [self initWithProperty:property]; | |
if (self) { | |
self.otherProperty = otherProperty; | |
} | |
return self; | |
} |
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
- (id)initWithProperty:(id)property | |
{ | |
return [self initWithProperty:property otherProperty:nil]; | |
} | |
- (id)initWithProperty:(id)property otherProperty:(id)otherProperty | |
{ | |
self = [super init]; | |
if (self) { | |
self.property = property; | |
self.otherProperty = otherProperty; | |
} | |
return self; | |
} |
Some documentation from Apple :) spoiler, they support Example B.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Plus one for Example B. https://twitter.com/collindonnell/status/346063000035266560