Created
August 19, 2011 05:48
-
-
Save alexeckermann/1156141 to your computer and use it in GitHub Desktop.
How to access the previous UIViewController from a pushed UIViewController your about to close
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)closeThisViewController { | |
// Lets retain an instance of the current navigation controller | |
UINavigationController *navController = [self.navigationController retain]; | |
// When this is called self.navigationController is no longer available | |
[self.navigationController popViewControllerAnimated: YES]; | |
// To talk to that previous VC here's what you do | |
[[navController topViewController] doSomethingHere:YES]; | |
// We retained it, lets release it! | |
[navController release]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment