Skip to content

Commit f26e083

Browse files
committed
Provided a designated -loadObjectsAtResourcePath which will give a reference of the objectLoader to the caller (Optional)
1 parent 2c225df commit f26e083

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Code/ObjectMapping/RKObjectManager.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ typedef enum {
329329
set on the mapping provider.
330330
*/
331331
- (void)loadObjectsAtResourcePath:(NSString *)resourcePath delegate:(id<RKObjectLoaderDelegate>)delegate;
332+
// Designated
333+
- (void)loadObjectsAtResourcePath:(NSString *)resourcePath delegate:(id<RKObjectLoaderDelegate>)delegate objectLoader:(RKObjectLoader**)outObjectLoader;
332334

333335
////////////////////////////////////////////////////////
334336
/// @name Mappable Object Loaders

Code/ObjectMapping/RKObjectManager.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,20 @@ - (id)loaderForObject:(id<NSObject>)object method:(RKRequestMethod)method
281281
}
282282

283283
- (void)loadObjectsAtResourcePath:(NSString *)resourcePath delegate:(id<RKObjectLoaderDelegate>)delegate
284+
{
285+
[self loadObjectsAtResourcePath:resourcePath
286+
delegate:delegate
287+
objectLoader:NULL];
288+
}
289+
290+
- (void)loadObjectsAtResourcePath:(NSString *)resourcePath delegate:(id<RKObjectLoaderDelegate>)delegate objectLoader:(RKObjectLoader**)outObjectLoader
284291
{
285292
RKObjectLoader *loader = [self loaderWithResourcePath:resourcePath];
286293
loader.delegate = delegate;
287294
loader.method = RKRequestMethodGET;
288-
295+
289296
[loader send];
297+
*outObjectLoader = loader;
290298
}
291299

292300
/////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)