Introduced loadObjectsAtResourcePath:delegate:block: helper

This commit is contained in:
Blake Watters
2011-07-28 16:26:40 -04:00
parent 4ed7a20f85
commit 46ab501cab
3 changed files with 42 additions and 0 deletions

View File

@@ -232,6 +232,21 @@ typedef enum {
#if NS_BLOCKS_AVAILABLE
/**
Load the objects at the specified resource path and perform object mapping on the response payload. Prior to sending the object loader, the
block will be invoked to allow you to configure the object loader as you see fit. This can be used to change the response type, set custom
parameters, choose an object mapping, etc.
For example:
- (void)loadObjectWithBlockExample {
[[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"/monkeys.json" delegate:self block:^(RKObjectLoader* loader) {
loader.objectMapping = [[RKObjectManager sharedManager].mappingProvider objectMappingForClass:[Monkey class]];
}
}
*/
- (RKObjectLoader*)loadObjectsAtResourcePath:(NSString*)resourcePath delegate:(id<RKObjectLoaderDelegate>)delegate block:(void(^)(RKObjectLoader*))block;
/**
Configure and send an object loader after yielding it to a block for configuration. This allows for very succinct on-the-fly
configuration of the request without obtaining an object reference via objectLoaderForObject: and then sending it yourself.