Skip to content

Instantly share code, notes, and snippets.

@plu
Created December 31, 2012 09:49
Show Gist options
  • Save plu/4418629 to your computer and use it in GitHub Desktop.
Save plu/4418629 to your computer and use it in GitHub Desktop.
2012-12-31 10:48:30.157 otest[48362:2a03] ITEMS: {(
<XingEntityConversation:0xec390f0 conversationID:467437519_1714c5 messageCount:1>
)}
2012-12-31 10:48:30.158 otest[48362:2a03] ITEMS.anyObject.participants: Relationship 'participants' on managed object (0xec390f0) <XingEntityConversation:0xec390f0 conversationID:467437519_1714c5 messageCount:1> with objects {(
<XingEntityUser:0xec31430 userID:654321_fedcba pageName:(null)>,
<XingEntityUser:0xec38b20 userID:123456_abcdef pageName:Max_Mustermann>
)}
2012-12-31 10:48:30.159 otest[48362:2a03] ITEMS.anyObject.participants.anyObject.professionalExperience: (null)
2012-12-31 10:48:30.160 otest[48362:2a03] W restkit.core_data:RKManagedObjectRequestOperation.m:590 Caught undefined key exception for keyPath 'items.participants.professionalExperience.educationalBackground.schools' in mapping result: This likely indicates an ambiguous keyPath is used across response descriptor or dynamic mappings.
for (RKMappingGraphVisitation *visitation in visitor.visitations) {
NSLog(@"visitation.rootKey: %@", visitation.rootKey);
id objectsAtRoot = [mappingResultDictionary objectForKey:visitation.rootKey];
if (objectsAtRoot == nil) continue;
NSLog(@"%@", objectsAtRoot);
id managedObjects = nil;
if ([visitation.keyPath isEqualToString:@"items.participants.professionalExperience.educationalBackground.schools"]) {
NSLog(@"ITEMS: %@", [objectsAtRoot valueForKey:@"items"]);
NSLog(@"ITEMS.anyObject.participants: %@", [[[objectsAtRoot valueForKey:@"items"] anyObject] valueForKey:@"participants"]);
NSLog(@"ITEMS.anyObject.participants.anyObject.professionalExperience: %@", [[[[[objectsAtRoot valueForKey:@"items"] anyObject] valueForKey:@"participants"] anyObject] valueForKey:@"professionalExperience"]);
}
@try {
managedObjects = visitation.keyPath ? [objectsAtRoot valueForKeyPath:visitation.keyPath] : objectsAtRoot;
}
@catch (NSException *exception) {
if ([exception.name isEqualToString:NSUndefinedKeyException]) {
RKLogWarning(@"Caught undefined key exception for keyPath '%@' in mapping result: This likely indicates an ambiguous keyPath is used across response descriptor or dynamic mappings.", visitation.keyPath);
continue;
}
[exception raise];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment