而不是集群:
- (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"]) {
// ...
}
}
}
我更喜欢一种block
方法,特别是对于没有任何对象映射的简单请求。是否有任何文档或示例说明如何使用块响应?