Created
January 29, 2014 19:24
-
-
Save ahmednuaman/8695022 to your computer and use it in GitHub Desktop.
NSMutableArray dealing with nil variables
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
NSMutableArray *fullName = [[NSMutableArray alloc] init]; | |
if (_firstName) { | |
[fullName addObject:_firstName]; | |
} | |
if (_middleName) { | |
[fullName addObject:_middleName]; | |
} | |
if (_lastName) { | |
[fullName addObject:_lastName]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment