Core Data-Beziehungen, die nicht mit RESTkit zugeordnet wurden
Ich habe Mühe, mithilfe von RESTkit 0.20.0-pre6 eine ordnungsgemäße Zuordnung der Core-Data-Beziehungen zu erhalten.
Ich möchte diesen JSON abbilden:
{ "items" : [ {"id" : 2001, "itemAttr1" : "..."}, ...<more items>... ],
"rooms": [ {"id" : 3001, "items": [2001, ...<more item id's>...] }
zu einem entsprechenden Core Data Modell:
Entity ItemMO (Attributes "id", "itemAttr1", Relationship "room" to RoomMO)
Entity RoomMO (Attributes "id", Relationship "items" to ItemMO)
Die Attribute werden gut zugeordnet, aber die Beziehungen sind leer.
Ich habe versucht mitRKConnectionDescription
wie beschriebenHierunter Verwendung dieses Codes:
NSEntityDescription *roomEntity = [NSEntityDescription entityForName:@"RoomMO" inManagedObjectContext:self.context];
NSRelationshipDescription *itemsInRoom = [roomEntity relationshipsByName][@"items"];
RKConnectionDescription *connection = [[RKConnectionDescription alloc] initWithRelationship:devicesInRoom keyPath:@"devices"];
[roomMapping addConnection:connection];
Ich habe es auch mit einem einfachen versuchtRKRelationshipMapping
umsonst:
[itemMapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:nil toKeyPath:@"room" withMapping:roomMapping]];
Ich muss etwas Einfaches vermissen, da dies für RESTkit kein exotischer Fall sein sollte. Irgendwelche Ideen?