Created
October 25, 2013 08:42
-
-
Save peerasak-u/7151506 to your computer and use it in GitHub Desktop.
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
| // Initialize Array | |
| NSMutableArray *dumbArray = [NSMutableArray new]; | |
| // Basically addObject | |
| [dumbArray addObject:@"A"]; | |
| [dumbArray addObject:@"B"]; | |
| [dumbArray addObject:@"C"]; | |
| [dumbArray addObject:@"D"]; | |
| // Insert Object at the top array | |
| [dumbArray insertObject:@"0" atIndex:0]; | |
| // Create Array And IndexSet | |
| NSArray *dumbArray2 = @[@"-3", @"-2", @"-1"]; | |
| NSIndexSet *dumbIndexSet = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [dumbArray2 count])]; | |
| // Insert Array at the top of array | |
| [dumbArray insertObjects:dumbArray2 atIndexes:dumbIndexSet]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment