I'm using RestKit to get 2 separate API's. I am getting the API's just fine, but I need to combine the two arrays into one array.
How would I do this? Here is my code, will post extra as needed, thanks!
(NSMutableArray *array is the array that will be the combination of hArray and iArray)
ViewController.m
@property (strong, nonatomic) NSArray *hArray;
@property (strong, nonatomic) NSMutableArray *array;
@property (strong, nonatomic) NSArray *iArray;
[[RKObjectManager sharedManager] loadObjectsAtResourcePath:
[NSString stringWithFormat:@"/n/?limit=200&l=%@&t=%@&apikey=111",
lAbbreviation, tID] usingBlock:^(RKObjectLoader *loader) {
loader.onDidLoadObjects = ^(NSArray *objects){
hArray = objects;
[_tableView reloadData];
};
[loader.mappingProvider setMapping:[F mapping] forKeyPath:@"f"];
loader.onDidLoadResponse = ^(RKResponse *response){
};
}];
[self.iObjectManager loadObjectsAtResourcePath:
[NSString stringWithFormat:@"/u/?client_id=111"]
usingBlock:^(RKObjectLoader *loader) {
loader.onDidLoadObjects = ^(NSArray *oI){
iArray = oI;
[_tableView reloadData];
};
[loader.mappingProvider setMapping:[Data mapping] forKeyPath:@"data"];
loader.onDidLoadResponse = ^(RKResponse *response){
};
}];