开发者

Objective-C methods that correspond to these JS methods?

What NSMutableArray methods correspond to the开发者_高级运维se Javascript Array methods?

  • 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:.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜