Created
July 25, 2013 22:03
-
-
Save ebruning/6084205 to your computer and use it in GitHub Desktop.
Restart application
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
http://stackoverflow.com/questions/5082738/ios-calling-app-delegate-method-from-viewcontroller | |
http://stackoverflow.com/questions/4399611/force-iphone-app-to-restart-programmatically | |
// call delegate method | |
MainClass *appDelegate = (MainClass *)[[UIApplication sharedApplication] delegate]; | |
[appDelegate.viewController resetAppToFirstController]; | |
- (void)resetAppToFirstController | |
{ | |
self.window.rootViewController = [[MyMainViewController alloc] initWithNibName:nil bundle:nil]; | |
// Add other navigation setup | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how to do it in cocoa application? I want to restart my cocoa application
thank you :)