Skip to content
This repository
Browse code

adding method for updating infinite scrolling handler and footer view

  • Loading branch information...
commit d5b5af3ee98f276dc321a2cea053a1a04edb8230 1 parent 20052bc
authored January 02, 2013
2  JMStatefulTableViewController/JMStatefulTableViewController.h
@@ -63,4 +63,6 @@ typedef enum {
63 63
 
64 64
 - (void) loadNewer;
65 65
 
  66
+- (void) updateInfiniteScrollingHandlerAndFooterView:(BOOL)shouldInfinitelyScroll;
  67
+
66 68
 @end
14  JMStatefulTableViewController/JMStatefulTableViewController.m
@@ -323,8 +323,18 @@ - (void) viewWillAppear:(BOOL)animated {
323 323
         shouldInfinitelyScroll = [self.statefulDelegate statefulTableViewControllerShouldInfinitelyScroll:self];
324 324
     }
325 325
 
  326
+    [self updateInfiniteScrollingHandlerAndFooterView:shouldInfinitelyScroll];
  327
+
  328
+    [self _loadFirstPage];
  329
+
  330
+    [super viewWillAppear:animated];
  331
+}
  332
+
  333
+- (void) updateInfiniteScrollingHandlerAndFooterView:(BOOL)shouldInfinitelyScroll {
326 334
     if (shouldInfinitelyScroll) {
327 335
         if(self.tableView.infiniteScrollingView.infiniteScrollingActionHandler == nil) {
  336
+            __block JMStatefulTableViewController *safeSelf = self;
  337
+            
328 338
             [self.tableView addInfiniteScrollingWithActionHandler:^{
329 339
                 [safeSelf _loadNextPage];
330 340
             }];
@@ -333,10 +343,6 @@ - (void) viewWillAppear:(BOOL)animated {
333 343
         self.tableView.infiniteScrollingView.infiniteScrollingActionHandler = nil;
334 344
         self.tableView.tableFooterView = nil;
335 345
     }
336  
-
337  
-    [self _loadFirstPage];
338  
-
339  
-    [super viewWillAppear:animated];
340 346
 }
341 347
 
342 348
 - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

0 notes on commit d5b5af3

Please sign in to comment.
Something went wrong with that request. Please try again.