gpt4 book ai didi

ios - 代码不在窗口层次结构 Root View 中

转载 作者:可可西里 更新时间:2023-11-01 04:46:36 24 4
gpt4 key购买 nike

<分区>

我在尝试链接我的 UIViewController 时遇到问题,但我遇到了最后一个错误。

Attempt to present ViewController whose view is not in the window hierarchy

这是我的代码:

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
NSString *title = [alertView buttonTitleAtIndex:buttonIndex];

if([title isEqualToString:@"Wokay"])
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"Vibes"];
[self.window.rootViewController presentViewController:vc animated:YES completion:nil];

}
}

代码错误:

Warning: Attempt to present <ViewController: 0x110634bc0> on <Login: 0x10951e7f0> whose view is not in the window hierarchy!

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com