Mar*_*ark 16 uiwebview uikit ios4 ios
嘿所有,我提出了一个模态视图控制器,并在UIWebView中的该视图控制器上加载一个网页:
- (void)viewWillAppear:(BOOL)animated
{
self.requestObj = [NSURLRequest requestWithURL:[NSURL URLWithString:[MPServerPrefs serverPrefs].url_of_sandwich]];
[self.helpWebView loadRequest:self.requestObj];
}
Run Code Online (Sandbox Code Playgroud)
如果我让网页加载然后关闭视图,一切正常.如果我在加载请求时关闭视图,我会得到这个堆栈跟踪:
#0 0x31a94466 in objc_msgSend
#1 0x35ebcb70 in -[UIWebView webView:identifierForInitialRequest:fromDataSource:]
#2 0x35ebc1c0 in -[UIWebViewWebViewDelegate webView:identifierForInitialRequest:fromDataSource:]
#3 0x36130d04 in __invoking___
#4 0x36130bd4 in -[NSInvocation invoke]
#5 0x36130730 in -[NSInvocation invokeWithTarget:]
#6 0x329fc2f4 in -[_WebSafeForwarder forwardInvocation:]
Run Code Online (Sandbox Code Playgroud)
我做了一些搜索,无法弄清楚发生了什么.有任何想法吗?在解雇视图控制器时是否需要取消我的请求?
非常感谢!
Mar*_*ark 42
傻傻的我 - 你只需要取消请求就可以取消代表!
[self.helpWebView setDelegate:nil];
[self.helpWebView stopLoading];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6770 次 |
| 最近记录: |