NSMutableArray方法对应于这些Javascript Array方法?
shift();
unshift();
slice();
splice();
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:
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.