UIWebView在第二个pdf加载请求时崩溃 [英] UIWebView crashing on second pdf load request

查看:197
本文介绍了UIWebView在第二个pdf加载请求时崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个UIWebView,我用来显示几个小PDF。用户从表中选择新闻文章,然后在同一屏幕上的UIWebView中加载文章(PDF)。第一次加载总是很好。然后我选择的下一个项目(无论哪一个)崩溃应用程序。

I have a UIWebView I'm using to show several small PDF's. The user selects a news article from a table and then the article(PDF) is loaded in a UIWebView on the same screen. The first load always goes just fine. Then the next item I select (no matter which one) crashes the app.

这就是我加载每篇文章的方式:

This is how I'm loading each article:

NSString *filePath = [[NSBundle mainBundle] pathForResource:articleFileName ofType:@"pdf"];
[articleView stopLoading];
[articleView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:filePath]]];

崩溃发生在loadRequest行之后。

崩溃没有提供错误信息。除了:

The crash occurs after the loadRequest line.
The crash gives no error information. Other than:

所有异常{} 0x3629f000

All Exceptions {} 0x3629f000

Catchpoint 3(抛出异常)。(gdb)

Catchpoint 3 (exception thrown).(gdb)

它只是崩溃到main()。我已在调试器中验证它在每个请求上使用了正确的文件路径。

It just crashes to main(). I have verified in the debugger that it is using the correct file path on each request.

我有NSZombies正在运行,并且我为所有异常设置了断点。

I have NSZombies running and I have breakpoints set for all exceptions.

推荐答案

我也有这个问题。非常感谢史蒂夫帮助我进一步缩小范围,我的例外情况与他的相同。

I have this exact problem as well. Big thanks to Steve for helping me narrow it down even further, my exception is the same as his.

您是否在所有例外情况下都有中断?我发现如果我禁用该断点,它不会再崩溃了。让我觉得这只是新调试器或iOS版本中的一些错误?让我想到的另一件事是,当我在使用iOS 4.3.x或4.3模拟器的设备上运行时,不会发生此崩溃。

Do you have break on all exceptions set? I found that if I disable that breakpoint, it doesn't crash any more. Which got me thinking it was just some bug in the new debugger or iOS version? The other thing that got me thinking that was that this crash does not occur when I run on a device with iOS 4.3.x or the 4.3 simulator.

这篇关于UIWebView在第二个pdf加载请求时崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆