如何通过有序关系订购多对多

时间:2014-07-30 16:00:26

标签: core-data relationship

有序关系效果很好......但我还没有找到关于如何使用支票的文件" ordered"在获取控制器中。

我的问题是:我如何对fetchcontroller进行排序?在-sortDescriptorWithKey:ascending:

中使用的密钥(SORT_VALUE)是什么

例如:

NSSortDescriptor *sortPlaylistSongs = [NSSortDescriptor sortDescriptorWithKey:@"SORT_VALUE" ascending:YES];

谢谢。

1 个答案:

答案 0 :(得分:0)

您可以通过以下方式设置排序描述符以获取请求:

fetchRequest.sortDescriptors = @[[sortPlaylistSongs]];

SORT_VALUE - 通常是属性名称。如果是Core Data的属性名称。

相关问题