讓我們假設ParentViewcontroller爲P,FirstViewController爲V1,SecondViewController爲V2。viewDidAppear呼籲在iOS8中被解僱的視圖控制器
我從V1提交V1,然後從V1提交V2。現在我想直接去P.對於這個我使用
[self.presentingViewController.presentingViewController dismissViewControllerAnimated:NO completion:nil];
這工作正常,在iOS7。但是在iOS8中,我這樣做時遇到了一個問題(不知道它是否是問題)。這是V1的viewDidAppear方法正在被調用,並且它的視圖在屏幕上小部分秒鐘也會出現問題。
這是iOS8功能還是錯誤?有沒有其他方法可以做到這一點?
ViewControllers呈現代碼。
從P,其中P是推視圖控制器,
ViewController1 *v1 = [[ViewController1 alloc] init];
[self presentViewController:v1 animated:NO completion:nil];
從V1,
ViewController2 *v2 = [[ViewController2 alloc] init];
[self presentViewController:v2 animated:NO completion:nil];
我不知道它是否會有所作爲,但dismissModalViewControllerAnimated:被折舊很久以前,您應該使用dismissViewControllerAnimated:completion :. – rdelmar 2014-10-20 15:14:40
謝謝@rdelmar。這是一個複製粘貼問題。複製了一箇舊代碼。編輯我的問題:)。 – iCanCode 2014-10-21 07:11:18
這看起來對我來說不是一個錯誤。這應該根據你在做什麼來預期。你如何呈現視圖控制器?張貼演示文稿代碼 – Lefteris 2014-10-21 07:38:08