开发者

Objective-C methods that correspond to these JS methods?

开发者 https://www.devze.com 2023-02-03 17:46 出处:网络
What NSMutableArray methods correspond to the开发者_高级运维se Javascript Array methods? shift();

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

精彩评论

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