Hi,
I have two managed objects which have a bidirectional relationship. It is a 'segmentWithDetails' which contains a 'segment' object.
I use
NSEntityDescription *entity = [NSEntityDescription entityForName:@"SegmentWithDetails"
inManagedObjectContext:connectionDetailsService.connectionDetailsContext];
[fetchRequest setEntity:entity];
to get my segmentWith Details. This works ok.
BUT, when I try to retrieve the contained segment, I get nil.
I've tried to get it with
Segment *segment = [segmentWithDetails valueForKeyPath:@"segment"];
and with
Segment *segment = segmentWithDetails.segment;
But this does not work (=nil). I've also tried modifying the NSFetchedResultsController. I added the following:
[fetchRequest setRelationshipKeyPathsForPrefetching:[NSArray arrayWithObject:@"segment"]];
[fetchRequest setIncludesSubentities:YES];
But both of these do not seem to make any difference. From what I understand out of Apple fine documentation, the relationship should just work using faults.
What am I missing here? How do I get to the relationship object 'segment' from 'segmentWithDetails' ??