RKObjectMapping *profilesMapping = [RKObjectMapping mappingForClass:[LVKUser class]];
[profilesMapping addAttributeMappingsFromArray:@[@"uid",
@"first_name",
@"last_name",
@"nickname"]];
RKResponseDescriptor *responseDescriptor =
[RKResponseDescriptor responseDescriptorWithMapping:profilesMapping
method:RKRequestMethodGET
pathPattern:@"users.get"
keyPath:@"response"
statusCodes:[NSIndexSet indexSetWithIndex:200]];
[objectManager addResponseDescriptor:responseDescriptor];
NSDictionary *params = @{@"fields": @"nickname", @"user_id": @"1"};
[[RKObjectManager sharedManager] getObjectsAtPath:@"users.get"
parameters:params
success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult){
NSLog(@"%@", mappingResult.array);
}
failure:^(RKObjectRequestOperation *operation, NSError *error){
NSLog(@"%@", error);
NSLog(@":c");
}
];
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
//не забыть проверить, кто такой sender
NSIndexPath *indexPath = [self.tableView indexPathForCell:sender];
//получить данные из datasource
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"PickGame"]) {
GamePickerViewController *gamePickerViewController = segue.destinationViewController;
gamePickerViewController.delegate = self;
gamePickerViewController.game = _game;
}
}