How to slice an NSArray in Objective-C?

前端 未结 1 870
太阳男子
太阳男子 2021-01-07 17:23

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

(much like the array_slice function in PHP)

1条回答
  •  渐次进展
    2021-01-07 17:30

    -[NSArray subarrayWithRange:]
    

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

    0 讨论(0)
提交回复
热议问题