Reputation: 58097
What NSMutableArray methods correspond to these Javascript Array methods?
shift();
unshift();
slice();
splice();
Upvotes: 2
Views: 751
Reputation: 243156
shift
is a combination of -objectAtIndex:0
and removeObjectAtIndex:0
.unshift
is insertObject:obj atIndex:0
. It does not return the new length, however.slice
is -[NSString substringWithRange:]
splice
has no equivalent, though you can approximate it with insertObjects:atIndexes:
.Upvotes: 8