在我的ios應用程序中,我使用下面顯示的代碼加載SecondViewController。當該視圖控制器出現時,我也運行viewDidAppear,如下面的代碼片段所示。 這工作正常。從那裏,我加載我的FifthViewController並做一些計算,需要返回到SecondViewController。 不幸的是,當我通過相同的確切方法返回到SecondViewController時,viewDidAppear方法無法運行。 任何建議如何解決這將不勝感激。viewDidAppear運行,然後不運行。
-(IBAction) loadSecondView:(id)sender
{
NSLog(@"In loadSecondView method \n");
[secondViewController viewDidAppear:YES];
[self clearView];
[self.view insertSubview:secondViewController.view atIndex:1];
}
'viewDidAppear:'is * not *你應該自己調用的方法 – borrrden 2012-08-02 02:54:33