Permalink
Browse files

'Don't pop last controller' issue fixed

  • Loading branch information...
1 parent 2a543d0 commit 5b53206370f623a412b8cc0f70e7a96329e02836 @bfolder committed May 2, 2012
View
@@ -254,16 +254,17 @@ -(NSArray *)popToViewController: (NSViewController *)viewController animated: (B
return nil;
NSViewController *visibleController = self.visibleViewController;
+
+ // Don't pop last controller
+ if(visibleController == viewController)
+ return nil;
+
NSUInteger index = [_viewControllers indexOfObject: viewController];
NSUInteger length = [_viewControllers count] - (index + 1);
NSRange range = NSMakeRange(index + 1, length);
NSArray *dispControllers = [_viewControllers subarrayWithRange: range];
[_viewControllers removeObjectsInArray: dispControllers];
- // Don't pop last controller
- if(visibleController == viewController)
- return nil;
-
// Navigate
[self _navigateFromViewController: visibleController toViewController: viewController animated: animated push: NO];

0 comments on commit 5b53206

Please sign in to comment.