maaash.jp

what I create

UINavigationController pushViewControllerしてpopViewControllerした時のUIViewControllerのメソッドの呼ばれ方

今さらながらmemo

RootViewControllerがapp.navigationControllerの先頭にある

2011-05-28 21:23:43.771 navcontrollertest[12548:207] RootViewController/viewDidLoad
2011-05-28 21:23:43.773 navcontrollertest[12548:207] RootViewController/viewWillAppear:
2011-05-28 21:23:43.775 navcontrollertest[12548:207] RootViewController/viewDidAppear:

そこにSecondViewControllerをpush

1
2
3
SecondViewController* c = [[SecondViewController alloc] initWithNibName: nil bundle: nil];<br />
[ self.navigationController pushViewController: c animated: YES ];<br />
[ c release ];<br />

2011-05-28 21:23:47.191 navcontrollertest[12548:207] SecondViewController/viewDidLoad
2011-05-28 21:23:47.192 navcontrollertest[12548:207] RootViewController/viewWillDisappear:
2011-05-28 21:23:47.192 navcontrollertest[12548:207] SecondViewController/viewWillAppear:
2011-05-28 21:23:47.548 navcontrollertest[12548:207] RootViewController/viewDidDisappear:
2011-05-28 21:23:47.549 navcontrollertest[12548:207] SecondViewController/viewDidAppear:

backボタンを押した

2011-05-28 21:23:53.395 navcontrollertest[12548:207] SecondViewController/viewWillDisappear:
2011-05-28 21:23:53.396 navcontrollertest[12548:207] RootViewController/viewWillAppear:
2011-05-28 21:23:53.749 navcontrollertest[12548:207] SecondViewController/viewDidDisappear:
2011-05-28 21:23:53.750 navcontrollertest[12548:207] RootViewController/viewDidAppear:
2011-05-28 21:23:53.751 navcontrollertest[12548:207] SecondViewController/dealloc

viewDidUnloadは呼ばれないが、deallocはちゃんと呼ばれている。

Comments