NSSortDescriptor *sortDescriptor; sortDescriptor = [[NSSortDescriptor alloc]initWithKey:@"dtDateReal" ascending:NO]...
分类:
编程语言 时间:
2015-08-28 17:21:18
阅读次数:
151
NSSortDescriptor可以实现按照对象的属性进行排序。比如我们有一个对象(LGPeople)。LGPeople有两个属性分别是名字(name)和年龄(age)。现在我们要按照LGPeople的年龄(age)来进行排序。
代码如下:
//按年龄排序
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc]...
分类:
编程语言 时间:
2015-04-13 21:01:27
阅读次数:
176