Meteor iOS 实体组与键“”的键值编码不兼容

Meteor iOS the entity Group is not key value coding-compliant for the key ""

我正在开发一个 iOS 应用程序,该应用程序将使用 meteor-ios 与 Meteor 服务器集成。

我从 swift todos 示例中复制了很多实用程序来尝试从 meteor 服务器加载对象列表并将它们加载到表视图中。

当 运行 应用程序时,我最终遇到了这个确切的错误。

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Group 0x7ff494e3c850> valueForUndefinedKey:]: the entity Group is not key value coding-compliant for the key "".'

我完全不知道从哪里开始挖掘这个或分享什么代码,所以任何帮助都将不胜感激。

找到问题了。错误消息让我失望,因为我认为这是一个分配问题。

问题是我将一个空字符串传递给获取的结果控制器,如下所示:

NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: managedObjectContext, sectionNameKeyPath: "", cacheName: nil)

sectionNameKeyPath 切换为 nil 解决了问题。