How to slice an NSArray in Objective-C?

江枫思渺然 提交于 2019-12-09 02:10:24

问题


What's the simplest way to extract a slice of an NSArray in Objective-C?

(much like the array_slice function in PHP)


回答1:


-[NSArray subarrayWithRange:]

Reference:
https://developer.apple.com/documentation/foundation/nsarray/1415157-subarraywithrange



来源:https://stackoverflow.com/questions/1752955/how-to-slice-an-nsarray-in-objective-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!