Created
July 11, 2013 08:25
-
-
Save satoshin2071/5973580 to your computer and use it in GitHub Desktop.
特定のVCまでpopするサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) popToBeforeHogeViewController | |
{ | |
// HogeViewController のインデックスを探す | |
NSInteger targetIndex = -1; | |
for (int i = 0; i < self.viewControllers.count; i++) | |
{ | |
if ([self.viewControllers[i] isKindOfClass:[HogeViewController class]]) | |
{ | |
targetIndex = i - 1; | |
break; | |
} | |
} | |
// あったら 直前までpopする | |
if (targetIndex > 0) | |
{ | |
[self popToViewController:(UIViewController*)self.viewControllers[targetIndex] animated:NO]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment