我需要从fetchedResultsController
。
我正在尝试确保将lastCell属性设置为YES
的实体成为其中最后一个显示的单元格。不知何故,它始终是第一个?这不可能吗?
从timeStamp订购效果很好。另一方面lastCell
似乎没有任何影响。
NSSortDescriptor *sortDescriptor1 = [[NSSortDescriptor alloc] initWithKey:@"timeStamp" ascending:NO];
NSSortDescriptor *sortDescriptor2 = [[NSSortDescriptor alloc] initWithKey:@"lastCell" ascending:NO];
答案 0 :(得分:5)
将lastCell的NSSortDescriptor设置为升序。毕竟,False(又名0)出现在True(1)之前。
答案 1 :(得分:0)
您可能会尝试创建一个简单的自定义比较方法来使用。这个问题对此很好: