关于Xcode中调试UIWebview加载PDF 崩溃的bug

打开Xcode进行调试UIWebView进行加载本地PDF进行显示,若连接Xcode会崩溃。不连接Xcode调试,直接打开app进行展示却不会崩溃。这应该是Xcode的一个bug。

self.title = @"最终用户许可协议";

NSString *path = [[NSBundle mainBundle] pathForResource:@"License_hemu" ofType:@"pdf"];

NSURL *url = [NSURL fileURLWithPath:path];

NSURLRequest *request = [NSURLRequest requestWithURL:url];

[self.showWebView  loadRequest:request];


Disabling the "Break on all Exceptions" breakpoint solved my problem, which was coming after UIWebPDFView _removeBackgroundImageObserverIfNeeded in the stacktrace. Who would think a breakpoint would cause a crash?


I've found that you can just continue in the debugger after hitting the breakpoint. There's probably an exception that's being caught and handled in Apple's code, so even through the exception triggers the breakpoint, it doesn't lead to a crash.


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.

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.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容