gpt4 book ai didi

ios - 谁的 View 不在 iOS 6.1 的窗口层次结构中

转载 作者:行者123 更新时间:2023-11-29 04:06:25 25 4
gpt4 key购买 nike

收到此错误。

2013-02-28 16:19:49.628 VLC[1416:907] Warning: Attempt to present on whose view is not in the window hierarchy!

这是我的代码

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// This will mark crashy files
[[MLMediaLibrary sharedMediaLibrary] applicationWillStart];

[_window addSubview:self.navigationController.view];
[_window setRootViewController:self.navigationController];
[_window makeKeyAndVisible];


NSURL * urlToOpen = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey];
urlToOpen = [NSURL URLWithString:@"rtsp://192.168.4.123"];

if (urlToOpen != nil) {
// We were started to open a given URL
MVLCMovieViewController * movieViewController = [[MVLCMovieViewController alloc] init];
movieViewController.url = urlToOpen;

[self.navigationController presentViewController:movieViewController animated:YES completion:NULL];
[movieViewController release];
}

return YES;
}

最佳答案

在添加到 window 之前,您尚未使用 UIViewController 初始化 navigationController

尝试一下:

YourViewController *object_yvc = [[YourViewController alloc] initWithNibName:@"YourViewController"
bundle:[NSBundle mainBundle]];
UINavigationController *navObject_vc = [[UINavigationController alloc] initWithRootViewController:object_yvc];

关于ios - 谁的 View 不在 iOS 6.1 的窗口层次结构中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15130688/

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