Skip to content

Instantly share code, notes, and snippets.

@toshinarin
Last active August 29, 2015 14:04
Show Gist options
  • Save toshinarin/d31ab66b2ac7754ed44f to your computer and use it in GitHub Desktop.
Save toshinarin/d31ab66b2ac7754ed44f to your computer and use it in GitHub Desktop.
NSMutableArray copy test
NSMutableArray *mary = [@[ @"a", @"b", @"c" ] mutableCopy];
NSArray *ary = [mary copy];
[mary removeLastObject];
NSString *str1 = [mary componentsJoinedByString:@", "];
NSString *str2 = [ary componentsJoinedByString:@", "];
NSLog(@"{str1: %@}, {str2: %@}", str1, str2); // {str1: a, b}, {str2: a, b, c}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment