【发布时间】:2014-11-06 12:03:56
【问题描述】:
我想按存储在对象数组中的值对 NSMutableArray 进行排序 :)
为了更好地了解我已经包含了数组。我想按时间排序(starttijd)
使用 NSSortDescriptor,我设法按状态 url 排序,而不是按时间排序。
这是我当前的排序代码:
NSSortDescriptor *sortDescriptor; sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"starttuhd" 升序:是]; NSArray *sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
sortedarray = [alleitems sortedArrayUsingDescriptors:sortDescriptors]; NSLog(@"Sorted array: %@", sortedarray);
【问题讨论】:
-
如果一个对象在
custom_fields内有多个对象,但starttijd日期不同怎么办?应该挑选什么进行分类? -
你的实际排序代码是什么?
-
永远只有1个starttijd
标签: ios sorting nsmutablearray nssortdescriptor