这段代码真的让我很困惑。当我输入 fetchObjectsForEntityName 时,它不提供建议,然后给我一个警告No visible @interface for 'NSManagedObjectContext' declares the selector 'fetchObjectsForEntityName:withPredicate:'
。
这是代码:
-(SyncObject *)objectWithSyncID:(NSString *)syncID inContext:(NSManagedObjectContext *)context {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"syncID == %@", syncID];
NSSet *set = [context fetchObjectsForEntityName:@"SyncObject" withPredicate:predicate];