【问题标题】:Can you use dot notation in the key parameter of NSSortDescriptor: sortDescriptorWithKey:?你可以在 NSSortDescriptor: sortDescriptorWithKey: 的关键参数中使用点符号吗?
【发布时间】:2014-02-16 12:28:53
【问题描述】:

当我有实际数据时,我预计会出现问题。我有一个要在 UITableView 中显示的实体计数。 Count 与实体 Service 具有多对一的关系,并且 Service 具有属性日期。我想按 Service.data 对计数记录进行排序。可以在 key 参数中使用@"Service.date" 吗?

TIA 标记

【问题讨论】:

    标签: cocoa-touch core-data ios7


    【解决方案1】:

    是的。 sortDescriptorWithKey:... 中的 key 参数可以是 key path 由多个点分隔的键组成。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-07-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-04
      相关资源
      最近更新 更多