Skip to content

Instantly share code, notes, and snippets.

@ahmednuaman
Created January 29, 2014 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmednuaman/8695022 to your computer and use it in GitHub Desktop.
Save ahmednuaman/8695022 to your computer and use it in GitHub Desktop.
NSMutableArray dealing with nil variables
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