NSArray中的数字排序? [英] Sort Numbers in NSArray?
本文介绍了NSArray中的数字排序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是推动我在墙上,我不能一起如何做这个。
This is driving me up the wall and I can't piece together how to do this.
我从一个plist提取我的数组,这个数组是满的数字(在plist中设置)。
I fetch my array from a plist, this array is full of numbers (as set in the plist). Now al I need to do is sort them so they are descending, but I can't work it out.
希望有人可以帮助,谢谢。
Hope someone can help out, thanks.
推荐答案
尝试此代码?
NSArray *array = /* loaded from file */;
array = [array sortedArrayUsingSelector: @selector(compare:)];
这篇关于NSArray中的数字排序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文