Ios 如何访问另一个表';是否使用谓词替换数据?

Ios 如何访问另一个表';是否使用谓词替换数据?,ios,core-data,nspredicate,Ios,Core Data,Nspredicate,我有一个iPad应用程序(XCode4.6、iOS 6.2、ARC和故事板)。我有一个CoreData存储,看起来像这样: "aApptKey = %@ and CLientInfo.ClientKey = %@" NSPredicate *predicate = [NSPredicate predicateWithFormat:@"aApptKey == %@ && client.aClientKey == %@", obj1, obj2]; 我需要从Appointmen

我有一个iPad应用程序(XCode4.6、iOS 6.2、ARC和故事板)。我有一个CoreData存储,看起来像这样:

"aApptKey = %@ and CLientInfo.ClientKey = %@"
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"aApptKey == %@ && client.aClientKey == %@", obj1, obj2];

我需要从AppointmentsInfo表访问两个表。核心数据不使用连接,因此我的想法如下:

"aApptKey = %@ and CLientInfo.ClientKey = %@"
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"aApptKey == %@ && client.aClientKey == %@", obj1, obj2];

工作谓词是什么样子的?

应该是这样的:

"aApptKey = %@ and CLientInfo.ClientKey = %@"
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"aApptKey == %@ && client.aClientKey == %@", obj1, obj2];

这是我根据您的答案构建的:NSPredicate*谓词=([NSPredicate predicateWithFormat:@“aApptKey==%”和ClientInfo.aClientKey==%@,apptSelected.aApptKey,apptSelected.aApptKey]);这就是我遇到的错误:**由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“在实体“AppointmentInfo*foundAppt=[AppointmentInfo MR_findFirstWithPredicate:predicate inContext:localContext]中找不到keypath ClientInfo.aClientKey”;您构造的谓词与@Scott的建议不匹配。除了和和之外还有什么不同?没有客户。。它是ClientInfo@spokane-都德:
client
是你们关系的名字。ClientInfo是实体的名称,但在构造谓词时不使用它。我刚才看到了!:这是漫长的一天。。。让我查一下钥匙。。。正如我指出的,它们是相同的;由于某种原因,它找不到数据。。。嗯