unknow object retrieve from core data
this is an NSDictionnary result of a fetchrequest :
{
"appelation_vin" = Bordeaux;
"id_dom" = 134;
"vin_domaine" = "0x5b33ce0 <x-coredata://41A4D74E-EF4D-41DA-96F9-7F15DAE46403/domaine/p134>";
},
Here's the mystery, vin_domaine is supposely the value of the relationship beetween two tables so i know the object type it s suppose to be (domaine) but i don't understand why it s not identified by core_data...
here is the request for much help
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
[fetchRequest setEntity:[NSEntityDescription entityForName:@"vin" inManagedObjectContext:managedObjectContext]];
[fetchRequest setReturnsObjectsAsFaults:NO];
[fetchRequest setResultType:NSDictio开发者_高级运维naryResultType];
[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"]];
Thx for help!
Have you set the domaine
entity to be the class you are expecting? It can be set in *xcdatamodel file in XCode (example).
精彩评论