【发布时间】:2012-03-22 15:50:08
【问题描述】:
我收到了以下崩溃报告(截断)
Exception Type: EXC_CRASH (SIGSEGV)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x36df00d8 __psynch_mutexwait + 24
1 libsystem_c.dylib 0x31760674 pthread_mutex_lock + 376
2 CoreFoundation 0x31f2338a CFRunLoopWakeUp + 50
3 WebCore 0x308d0bc8 _WebThreadRun + 284
4 UIKit 0x37921c7a -[UIWebDocumentView _runLoadBlock:] + 38
5 UIKit 0x37921c3a -[UIWebDocumentView _cleanUpFrameStateAndLoad:] + 114
6 UIKit 0x37921bbe -[UIWebDocumentView loadHTMLString:baseURL:] + 78
担心的是调用代码如下所示:
@try {
[webView loadHTMLString:htmlString baseURL:nil];
[webView setNeedsDisplay];
}
@catch (NSException *exception) {...}
那么,我是如何设法从异常处理程序中抛出异常的?
我没有从 catch 内部调用 throwing 方法。我所做的只是将异常、webView 和 htmlString 转储到 NSLog。如果他们导致异常,我希望崩溃堆栈看起来不同。
这似乎减少了潜在的操作系统错误?
【问题讨论】:
标签: ios exception exception-handling