如何使用嵌套的 NSArray 对 NSArray 进行排序
你好,我是 Objective-C 的新手,我尝试做一些尝试。 我有一个名为“values”的 NSArray。它是一个数组的数组。看起来像:
[“0”=> “aString”,6872,5523,0091]
[“1”=> “另一个字符串”,4422,1234,0091]
[“2”=> "aString",6812,2143,0314] ...
如何对“值”数组比第一个整数值进行排序? 我应该使用 NSPredicate 吗? 请帮我举一些例子。 谢谢
Hi I'm new with the Objective-C and i try to do some try.
I have an NSArray called "values". It is an array of array. It seems like :
["0" = > "aString",6872,5523,0091]
["1" = > "anotherString",4422,1234,0091]
["2" = > "aString",6812,2143,0314] ...
How do I sort the "values" array than the first integer value?
I should use the NSPredicate ?
please help me with some example.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
与 block 类似的东西(假设您的整数值是 NSNumber 或某个可以比较的类):
Something like that with block (assuming that your integer value are NSNumber or some class that can be compared):