The "teamMembers" variable was not used.

The variable "relationship" is not defined, and looks like it should be "teamMembers" instead.

This is a bit inconsequent with the example above, that is named "userRelationship". Either both or neither of them should include the word "relationship".
This commit is contained in:
Victor Widell
2013-02-15 18:27:28 +01:00
parent 429a5d36f1
commit 2fa9b52dba

View File

@@ -62,7 +62,7 @@
NSEntityDescription *projectEntity = [NSEntityDescription entityForName:@"Project" inManagedObjectContext:managedObjectContext];
NSRelationshipDescription *teamMembers = [projectEntity relationshipsByName][@"teamMembers"]; // To many relationship for the `User` entity
RKConnectionDescription *connection = [[RKConnectionDescription alloc] initWithRelationship:relationship attributes:@{ @"teamMemberIDs": @"userID" }];
RKConnectionDescription *connection = [[RKConnectionDescription alloc] initWithRelationship:teamMembers attributes:@{ @"teamMemberIDs": @"userID" }];
When evaluating the above JSON, the connection would be established for the 'teamMembers' relationship to the `User` entities whose userID's are 1, 2, 3 or 4.