[英]Objective-C methods that correspond to these JS methods?
NSMutableArray方法对应于这些Javascript Array方法?
shift();
unshift();
slice();
splice();
shift
is a combination of -objectAtIndex:0
and removeObjectAtIndex:0
. shift
是-objectAtIndex:0
和removeObjectAtIndex:0
。 unshift
is insertObject:obj atIndex:0
. unshift
是insertObject:obj atIndex:0
。 It does not return the new length, however. slice
is -[NSString substringWithRange:]
slice
是-[NSString substringWithRange:]
splice
has no equivalent, though you can approximate it with insertObjects:atIndexes:
. splice
没有等效,尽管你可以用insertObjects:atIndexes:
近似它insertObjects:atIndexes:
.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.