Instead of a clustered:
- (void)objectLoader:(RKObjectLoader *)objectLoader didLoadObjects:(NSArray *)objects
{
if (objectLoader.method == RKRequestMethodGET) {
if ([objectLoader.resourcePath isEqualToString:@"/blah"]) {
// ...
}
} else if (objectLoader.method == RKRequestMethodPUT) {
if ([objectLoader.resourcePath hasSuffix:@"/blahblah"]) {
// ...
}
} else if (objectLoader.method == RKRequestMethodPOST) {
if ([objectLoader.resourcePath isEqualToString:@"/blahblahblah"]) {
// ...
}
}
}
I'd prefer a block
approach, especially for simpler requests without any object mapping. Is there any documentation or example of how to use block response?