Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
loadTableFromResourcePath: should be chained to loadTableFromResource…
…Path:usingBlock: Closes RestKit#782.
  • Loading branch information
jawwad committed May 31, 2012
1 parent 523b31f commit 9b25c6b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Code/UI/RKTableController.m
Expand Up @@ -232,15 +232,17 @@ - (void)loadTableItems:(NSArray *)tableItems {

#pragma mark - Network Table Loading

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

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

#pragma mark - Forms
Expand Down

0 comments on commit 9b25c6b

Please sign in to comment.