从核心数据中检索的未知对象

时间:2011-01-06 11:34:32

标签: iphone objective-c core-data

这是fetchrequest的NSDictionnary结果:

    {
    "appelation_vin" = Bordeaux;
    "id_dom" = 134;
    "vin_domaine" = "0x5b33ce0 <x-coredata://41A4D74E-EF4D-41DA-96F9-7F15DAE46403/domaine/p134>";
},

这就是谜,vin_domaine假设是两个表之间的关系的值,所以我知道它假设的对象类型(domaine)但我不明白为什么它没有被core_data识别...

这是请求帮助

NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
[fetchRequest setEntity:[NSEntityDescription entityForName:@"vin" inManagedObjectContext:managedObjectContext]];

[fetchRequest setReturnsObjectsAsFaults:NO];

[fetchRequest setResultType:NSDictionaryResultType];
[fetchRequest setReturnsDistinctResults:YES];
[fetchRequest setPropertiesToFetch:[NSArray arrayWithObjects:@"appelation_vin",@"id_dom",@"vin_domaine",nil]];


NSString *mysearch= [NSString stringWithFormat:@"appelation_vin= '%@'",appelation];
NSPredicate *predicate = [NSPredicate predicateWithFormat:mysearch,10];
[fetchRequest setPredicate:predicate];
[fetchRequest setRelationshipKeyPathsForPrefetching:[NSArray arrayWithObject:@"domaine"]];

寻求帮助!

1 个答案:

答案 0 :(得分:0)

您是否将domaine实体设置为您期望的课程?它可以在XCode(example)中的* xcdatamodel文件中设置。