从 didFinishLaunchingWithOptions 中呈现模式视图
我正在尝试将数据从以前的版本迁移到实际的数据格式。当应用程序执行此操作时,我想呈现一个显示等待消息(或进度,尚未决定......)的视图。
目前,我正在计算何时在 AppDelegate didFinishLaunchingWithOptions 方法中进行迁移,然后我想呈现该视图模式。但这根本不起作用。
我尝试
[navigationController pushViewController:viewController animated:YES]; // works in a way, but it's not modal and it navigates sideways
[navigationController presentModalViewController:viewController animated:YES]; // does nothing.
也搜索了这个论坛并找到了一些有关 TabViewController 的答案。我尝试将其应用到我的场景中,甚至尝试过:
[window addSubview:viewController.view];
[window makeKeyAndVisible];
这完全没有任何作用。有什么想法吗?
谢谢,
马克
I'm trying to migrate the data from a previous version to the actual data format. While the application does this, I want to present a view which displays a waiting message (or a progress, haven't decided yet...).
Currently I'm figuring out when to migrate in the method AppDelegate didFinishLaunchingWithOptions
and then I want to present that view modal. But it doesn't work at all.
I tried
[navigationController pushViewController:viewController animated:YES]; // works in a way, but it's not modal and it navigates sideways
[navigationController presentModalViewController:viewController animated:YES]; // does nothing.
I also searched this forum and found some answers regarding a TabViewController. I tried to apply that to my scenario and even tried:
[window addSubview:viewController.view];
[window makeKeyAndVisible];
Which does exactly nothing. Any ideas?
Thanks,
Mark
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你实例化了窗口吗?
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen]bounds]] autorelease];
Did you instantiate the window?
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];