因此,在我的應用程序中,我得到了視圖控制器導航之間的空白屏幕。我覺得dismissViewControllerAnimated是罪魁禍首。因此,在一個地方,我改變了這下面的代碼 -dismissViewControllerAnimated導致黑屏ios目標c
[vc dismissViewControllerAnimated:YES completion:^() {
BCDThankYouViewController *thankuView=[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"ThankyouView"];
[[self topViewController ]presentViewController:thankuView animated:YES completion:nil];
}];
有了這個下面的代碼 -
[vc dismissViewControllerAnimated:YES completion:nil];
BCDThankYouViewController *thankuView=[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"ThankyouView"];
[[self topViewController ]presentViewController:thankuView animated:YES completion:nil];
其中,Vc是 -
UIViewController *vc = self.presentingViewController;
while (vc.presentingViewController) {
vc = vc.presentingViewController;
}
和它的工作。但是,在我的應用程序的其他部分我有這樣下面的代碼 -
[weakPresentingViewController dismissViewControllerAnimated:_animateClosingModal completion:^{
[weakSelf handleDelayedLoginActions:userInfo withPortfolio:portfolio];
}];
我改變了它 -
[weakPresentingViewController dismissViewControllerAnimated:_animateClosingModal completion:nil];
[weakSelf handleDelayedLoginActions:userInfo withPortfolio:portfolio];
但我仍然看到我的下一個頁面加載前一個空白屏幕。在這段代碼weakPresentingViewController是
id __weak weakSelf = self;
UIViewController * __weak weakPresentingViewController = (UIViewController *)_loginManagerDelegate;
請讓我知道這裏有什麼問題嗎?爲什麼我在頁面加載前變黑屏?