What NSMutableArray methods correspond to the开发者_高级运维se Javascript Array methods?
shift();
unshift();
slice();
splice();
shift
is a combination of-objectAtIndex:0
andremoveObjectAtIndex:0
.unshift
isinsertObject:obj atIndex:0
. It does not return the new length, however.slice
is-[NSString substringWithRange:]
splice
has no equivalent, though you can approximate it withinsertObjects:atIndexes:
.
精彩评论