我在核心数据中有一个事件实体,其属性为 eventName、eventDate、eventLocation。我使用 SortDescriptors 作为 key eventDate。我在这里有一个问题,我需要设置位置首选项,我需要根据位置进行排序,而不是作为键值..例如,假设我将位置设置为“西雅图”,而不是所有具有西雅图位置的事件都应首先显示。您知道如何使用 FetchControllers 执行此操作..请在回答之前阅读问题
我不想
[NSSortDescriptor sortDescriptorWithKey:@"eventLocation" ascending:YES];
但类似的东西
[NSSortDescriptor sortDescriptorWithKey:@"eventLocation==Seattle" ascending:YES];
(这是错误的,我知道这是谓词格式)