【发布时间】:2014-09-21 09:05:10
【问题描述】:
我的 iPhone 应用在 iOS
我正在使用 webView 来显示我的应用程序的大部分内容,经过一些更改后,我检查是否通过 X 分钟,如果没有,我不做任何事情并继续显示当前页面,但如果是,我所做的就是从开始:
UIWindow *window = [UIApplication sharedApplication].keyWindow;
CDVViewController *rootViewController = (CDVViewController *)window.rootViewController;
[rootViewController.webView reload];
在reload 我遇到崩溃+错误:
-[_UIAlertShimPresentingViewController webView]: unrecognized selector sent to instance 0x17de2800
2014-09-21 11:56:43.719 myapp4[803:191017] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_UIAlertShimPresentingViewController webView]: unrecognized selector sent to instance 0x17de2800'
任何想法可能是什么问题?
添加:
要重新加载webView,我正在从AppDelegate 调用SessionManager 对象中的一个方法,这应该是为了工作:
AppDelegate.m
[SessionManager reload]
在SessionManager 中,该方法正在做我在乞讨中写的所有内容。
我尝试从AppDelegate 输入对webView 的呼叫,它成功了:
[viewController.webView reload]
但我不想对AppDelegate 中的会话逻辑进行太多更改,而是更喜欢在SessionManager 上进行更改...我还能从SessionManager 类中调用它吗?
【问题讨论】: