Skip to content
This repository was archived by the owner on Feb 21, 2022. It is now read-only.

Commit 9b25c6b

Browse files
committed
loadTableFromResourcePath: should be chained to loadTableFromResourcePath:usingBlock: Closes RestKit#782.
1 parent 523b31f commit 9b25c6b

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Code/UI/RKTableController.m

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,15 +232,17 @@ - (void)loadTableItems:(NSArray *)tableItems {
232232

233233
#pragma mark - Network Table Loading
234234

235-
- (void)loadTableFromResourcePath:(NSString*)resourcePath {
236-
NSAssert(self.objectManager, @"Cannot perform a network load without an object manager");
237-
[self loadTableWithObjectLoader:[self.objectManager loaderWithResourcePath:resourcePath]];
235+
- (void)loadTableFromResourcePath:(NSString *)resourcePath
236+
{
237+
[self loadTableFromResourcePath:resourcePath usingBlock:nil];
238238
}
239239

240-
- (void)loadTableFromResourcePath:(NSString *)resourcePath usingBlock:(void (^)(RKObjectLoader *loader))block {
241-
RKObjectLoader* theObjectLoader = [self.objectManager loaderWithResourcePath:resourcePath];
242-
block(theObjectLoader);
243-
[self loadTableWithObjectLoader:theObjectLoader];
240+
- (void)loadTableFromResourcePath:(NSString *)resourcePath usingBlock:(void (^)(RKObjectLoader *loader))block
241+
{
242+
NSAssert(self.objectManager, @"Cannot perform a network load without an object manager");
243+
RKObjectLoader *objectLoader = [self.objectManager loaderWithResourcePath:resourcePath];
244+
if (block) block(objectLoader);
245+
[self loadTableWithObjectLoader:objectLoader];
244246
}
245247

246248
#pragma mark - Forms

0 commit comments

Comments
 (0)