The relationship variable was missing.

In the example, a variable named "relationship" is used, but not created. On the line above, another variable "userRelationship" is created but not used.

I'm assuming this is a typo, and they are supposed to be the same?
This commit is contained in:
Victor Widell
2013-02-15 18:18:10 +01:00
parent 6feb49c8cd
commit 429a5d36f1

View File

@@ -40,7 +40,7 @@
NSEntityDescription *projectEntity = [NSEntityDescription entityForName:@"Project" inManagedObjectContext:managedObjectContext];
NSRelationshipDescription *userRelationship = [projectEntity relationshipsByName][@"user"];
RKConnectionDescription *connection = [[RKConnectionDescription alloc] initWithRelationship:relationship attributes:@{ @"userID": @"userID" }];
RKConnectionDescription *connection = [[RKConnectionDescription alloc] initWithRelationship:userRelationship attributes:@{ @"userID": @"userID" }];
Note that the value for the `attributes` argument is provided as a dictionary. Each pair within the dictionary correspond to an attribute pair in which the key is an attribute on the source entity (in this case, the `Project`) and the value is the destination entity (in this case, the `User`).