У меня есть объект A, подобный следующему:
@interface A : NSManagedObject
{
}
@property (nonatomic, retain) NSString *stringProperty;
, у которого есть подраздел B, подобный этому:
@interface B : A
{
}
Я хотел бы выполнить выборку для B, используя свойствохранится в A. Примерно так:
NSManagedObjectContext *context = [delegate mainManagedObjectContext];
NSEntityDescription *entityDescription = [NSEntityDescription entityForName:@"B" inManagedObjectContext:context];
NSFetchRequest *request = [[NSFetchRequest alloc] init];
[request setEntity:entityDescription];
NSPredicate *pred = [NSPredicate predicateWithFormat:@"stringProperty = %@", someString];
[request setPredicate:pred];
Возможно ли это?В настоящее время я получаю следующую ошибку:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'keypath stringProperty not found in entity <NSSQLEntity B id=26>'