我有兩個視圖與他們的控制器。 應用程序以FirstViewController
開頭。 然後用一個按鈕打開SecondViewController
。識別我何時返回ViewController
使用其他按鈕,我忽略SecondViewController
返回到FirstViewController
。
有沒有什麼辦法可以檢測到FirstViewController
它已經恢復了焦點?
編輯:好吧,我看看答案,我用viewWillAppear
但如果我使用UIModalPresentationFormSheet
不工作。
-(IBAction)openSecondView{
SecondViewController *screen = [[SecondViewController alloc] initWithNibName:nil bundle:nil];
screen.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
screen.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:screen animated:YES];
[screen release];
}
然後用關閉按鈕關閉此視圖。
viewWillAppear
從未叫過。
我用它但沒有工作。 。 謝謝。 – JSanchez