ストーリーボードは使用していません。そして現在ViewController1にあります。ここでは、ボタン クリック イベントでこのコードを呼び出します。
InnerViewController *innerVc = [[InnerViewController alloc] initWithNibName:@"InnerViewController" bundle:nil titleText:@"vaibhav"];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:innerVc];
nav.restorationIdentifier = @"innerNavSR";
[self.navigationController presentViewController:nav animated:YES completion:nil];
そして、InnerViewControllerrestorationIdentifier
でrestorationClass
与えられます。私はrestore.likeのために書かれた適切な方法を持っています
viewControllerWithRestorationIdentifierPath
encode and decode restoration.
私が変更した場合
[self.navigationController presentViewController:nav animated:YES completion:nil];
に
[self.navigationController pushViewController:innerVc animated:YES];
それは正常に動作します。現在の何が欠けているか、または間違っていますか。試しに、私もこれを試しました:
[self presentViewController:nav animated:YES completion:nil];
しかし、役に立たない。うまくいきません。
発表時の結果は -
viewControllerWithRestorationIdentifierPath
とdecodeRestorableStateWithCoder
呼ばれています。コールも入っていますが、入ってviewdidload
いませんviewwillappear
。と私は視覚的に見てViewcontroller1
います。しかし、それはすべて問題ありませんpush
プレゼントには何か特別なものが必要です か??