State Restoration issue in iOS Application
I have integrated the MMDrawerController Library in an iOS application and now I have a requirement to Restore application state even though application is killed in background(Only when application is enter from foreground to background), it is working fine with normal navigation application but when I change Navigation using "setCenterViewController" option in my application, restoration is not working as expected and I have followed all instruction provided in this link: "https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/PreservingandRestoringState.html"
and here is the code snippet:
AppDelegate appDelegate = (AppDelegate)[[UIApplication sharedApplication] delegate]; appDelegate.homeController.navigationController.navigationBarHidden = YES; HomeViewController *homeVC = [[HomeViewController alloc] initWithNibName:@"HomeViewController" bundle:nil]; UINavigationController *_navg = [[UINavigationController alloc]initWithRootViewController:homeVC]; _navg.restorationIdentifier = @"homeNavigationController"; homeVC.title = [self.dataSource objectAtIndex:indexPath.row]; homeVC.restorationIdentifier = @"HomeViewController"; [appDelegate.drawerController setCenterViewController:_navg withCloseAnimation:YES completion:nil]; self.currentViewController = _navg; self.currentViewController.restorationIdentifier = @"homeNavigationController";