在我的核心数据模型中,我有一个 Person 实体,它与 Course 实体具有“对多”关系(我也有从 Course 到 Person 的反向“对一个”关系)。
现在我有一个子类 UITableViewController 使用 NSFetchedResultsController 来显示工作正常的 Person 对象。我有这个设置,以便当您单击一个人时,它会发布另一个使用 NSFetchedController 的子类 UITableViewController 以及显示与该人关联的课程。
问题:每当我单击 Person 并尝试显示 Course UITableViewController 时,我都会收到此异常...
"Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'keypath name not found in entity <NSSQLEntity Course id=2>
'"
关于如何解决或排除故障的任何想法?
两个 ViewController 之间的代码几乎相同,除了 NSFetchedResultsController 被配置为一个中的“Person”实体和另一个中的“Course”实体