我有这段代码,我试图获取某个键的所有记录:
// if the apptObject.aApptKey is nil, skip it...
if(apptObject.aApptKey == nil)
continue; // go to beginning and try again
// using apptObject.aApptKey, get the client's name
NSPredicate *predicate = ([NSPredicate predicateWithFormat:@"(aClientKey = %@)", apptObject.aApptKey]);
clientInfo = [ClientInfo MR_findAllWithPredicate: predicate];
问题是我收到此错误(由 Crashlytics 提供):
致命异常:NSInvalidArgumentException +entityForName:nil 不是搜索实体名称“ClientInfo”的合法 NSManagedObjectContext 参数
要么不明白错误消息告诉我什么,要么我不明白如果我在 MR_findAll 之前测试 nil 会发生什么。请注意,所讨论的“密钥”完全相同,我只是使用约会密钥来获取客户的姓名。
有人可以解释这是怎么发生的吗?