title: RestKit Core Data mapping one to many
body: <p>I am using RestKit to map the following JSON to core data. </p>
  
  <p>This is my model:
  <img src="https://i.stack.imgur.com/BnUJc.png" alt="enter image description here"></p>
  
  <p>this is my methods:</p>
  
  <pre><code> RKEntityMapping *userMapping = [RKEntityMapping mappingForEntityForName:NSStringFromClass([User class]) inManagedObjectStore:managedObjectStore];
      userMapping.identificationAttributes = @[@"id"];
      [userMapping addAttributeMappingsFromDictionary:@{
                                                           @"birthday":@"birthday",
                                                           @"email":@"email",
                                                           @"facebook_token":@"facebook_token",
                                                           @"first_name":@"first_name",
                                                           @"gender":@"gender",
                                                           @"interested_in":@"interested_in",
                                                           @"last_name":@"last_name",
                                                           @"password":@"password",
                                                           @"m8_status":@"m8_status",
                                                           @"status":@"status",
                                                           @"languages": @"languages",
                                                           @"hometown":@"hometown",
                                                           @"location":@"location",
                                                           @"avatar_url":@"avatar_url",
                                                           @"mood":@"mood"
                                                           }];
   RKEntityMapping *findUserMapping = [RKEntityMapping mappingForEntityForName:NSStringFromClass([FindUser class]) inManagedObjectStore:managedObjectStore];
      findUserMapping.identificationAttributes = @[@"id"];
      [findUserMapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@"users" toKeyPath:@"users" withMapping:userMapping]];
  
    [manager addResponseDescriptorsFromArray:@[
  
  
  
                                                 [RKResponseDescriptor responseDescriptorWithMapping:findUserMapping
                                                                                         pathPattern:@"/v1/users"
                                                                                             keyPath:nil                                                                                      statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)]
  
                                                 ]];
  </code></pre>
  
  <p>This is getting objects from example JSON:</p>
  
  <pre><code>{
  "users": [
  {
  "avatar_url": null,
  "birthday": "04/11/1984",
  "email": "antonina.duminskaya@wildermancruickshank.co.uk", "first_name": "Antonina",
  "gender": "female",
  "hometown": null,
  "id": "5264ee384d61632c4b2f0000",
  "interested_in": [
  "male",
  "female" ],
  "languages": [], "last_name": "Duminskaya", "location": null, "m8_status": null,
  "mood": null,
  "status": null
  } ]
  }
  </code></pre>
  
  <p>here:</p>
  
  <pre><code> [objectManager getObjectsAtPath:@"/v1/users" parameters:@{@"session_id":session.id} success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) {
             FindUser *findUsers = [[self.fetchedFindUsersResultsController fetchedObjects] lastObject];
              NSLog(@"%@", findUsers.users);
  
  
         } failure:^(RKObjectRequestOperation *operation, NSError *error) {
  
         }];
  </code></pre>
  
  <p>I have message in log: </p>
  
  <pre><code>Relationship 'users' fault on managed object (0x8e964a0) &lt;FindUser: 0x8e964a0&gt; (entity: FindUser; id: 0x8da0790 &lt;x-coredata://083BB731-FDD7-4A35-A174-724F50862A02/FindUser/p1&gt; ; data: {
      id = nil;
      users = "&lt;relationship fault: 0x8deb260 'users'&gt;";
  })
  </code></pre>
  
  <p>And In mappingResults I have all results about json</p>