mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-05-12 03:06:30 +08:00
Introduced loadObjectsAtResourcePath:delegate:block: helper
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user