【发布时间】:2014-12-15 14:00:22
【问题描述】:
在我的 iOS 7+ 应用中,我使用的是最新版本的 Harpy,它会执行应用版本检查,如果 App Store 中有我的应用的新版本可用,它会发出警报。
由于我的应用程序的结构,我在调试器中遇到了这个问题:
Attempt to present <UIAlertController: 0x144538530> on <DCLoginViewController: 0x14460c1a0> whose view is not in the window hierarchy!
这是因为 harpy 是在 AppDelegate 中配置的,并且有一个参数定义了presentingViewController:
[[Harpy sharedInstance] setPresentingViewController:_window.rootViewController];
我相信问题的出现是因为我的应用程序检查用户是否已经登录,如果是这样,它不会显示 DCLoginViewController,而是跳转到下一个视图“LoadingViewController”。
如何将presentingViewController 设置为此LoadingViewController 甚至是执行时当前屏幕上的ViewController?
感谢您的帮助。
【问题讨论】:
标签: objective-c appdelegate presentviewcontroller