Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下型号
我可以使用 对Category实体进行排序NSDescriptor,但children属性(NSSet)未排序。我怎样才能childrens排序?
Category
NSDescriptor
children
childrens
对于每个获取的类别,您必须自己对子项进行排序。
NSArray *sortedChildren = [category.children sortedArrayUsingDescriptors: [NSArray arrayWithObject: [NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES]]];
BTW:“child”的复数形式是“children”。