MMDrawerControllerライブラリを iOS アプリケーションに統合しました。アプリケーションがバックグラウンドで強制終了された場合でも (アプリケーションがフォアグラウンドからバックグラウンドに移行した場合のみ)、アプリケーションの状態を復元する必要があります。通常のナビゲーション アプリケーションでは問題なく動作していますが、アプリケーションで「 setCenterViewController 」オプションを使用してナビゲーションを変更すると、復元が期待どおりに機能せず、次のリンクに記載されているすべての指示に従いました。 "
setCenterViewControllerオプション (MMDrawer から推奨) を使用して特定の画面に移動し、バックグラウンドでアプリを削除しました。再度開くと、デフォルトの初期画面で起動しますが、バックグラウンドに入る前の画面で再度開く必要があると予想しています。
コードスニペットは次のとおりです。
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";
この問題の解決を手伝ってください。