Hi,
I want to open the last tab the user left in UITabBarController.
I used this code but it didn't work:
I'd like to get help
Thanks!
I want to open the last tab the user left in UITabBarController.
I used this code but it didn't work:
Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
tabBarController.selectedIndex =
[[NSUserDefaults standardUserDefaults] integerForKey:@"lastOpenedTab"];
}
- (void)applicationWillTerminate:(UIApplication *)application {
NSUserDefaults *lastTab = [NSUserDefaults standardUserDefaults];
[lastTab setInteger:tabBarController.selectedIndex forKey:@"lastOpenedTab"];
}
I'd like to get help
Thanks!