MonoTouch:加载网页后调用 UIWebView.LoadHTMLString
当 UIWebView 包含使用 LoadRequest 的外部网站时,然后调用 LoadHtmlString(),您会收到此错误.有没有办法解决这个问题?
When a UIWebView contains an external web site using LoadRequest, then the LoadHtmlString() is called, you get this error. Is there a way around this?
0 OilGasDictionary 0x000908ec mono_handle_native_sigsegv + 284
1 OilGasDictionary 0x00005c42 mono_sigsegv_signal_handler + 178
2 libsystem_c.dylib 0x9555059b _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 OilGasDictionary 0x00169eee mono_runtime_invoke + 126
5 OilGasDictionary 0x0020c14d monotouch_exception_handler + 61
6 CoreFoundation 0x011c112c __handleUncaughtException + 76
7 libobjc.A.dylib 0x0359ef43 _objc_terminate + 86
8 libc++abi.dylib 0x0437d8de _ZL19safe_handler_callerPFvvE + 13
9 libc++abi.dylib 0x0437d946 __cxa_bad_typeid + 0
10 libc++abi.dylib 0x0437eb3e __cxa_current_exception_type + 0
11 libobjc.A.dylib 0x0359ee49 objc_exception_rethrow + 47
12 CoreFoundation 0x010f7e10 CFRunLoopRunSpecific + 304
13 CoreFoundation 0x010f7ccb CFRunLoopRunInMode + 123
14 WebCore 0x07395220 _ZL12RunWebThreadPv + 560
15 libsystem_c.dylib 0x954f8ed9 _pthread_start + 335
16 libsystem_c.dylib 0x954fc6de thread_start + 34
如果没有看到一些示例代码就很难确定,但是因为 UIWebView.LoadRequest
不是 reentrant 你应该注意确保 LoadHtmlString
在请求完成加载之前不被调用(他们可能共享一些逻辑和可能相同的限制).
It's hard to be sure without seeing some sample code but since UIWebView.LoadRequest
is not reentrant you should take care to ensure LoadHtmlString
is not called until the request has finished loading (they likely share some logic and potentially the same limitation).
我自己的示例就是这样做的(因为我最近了解了可重入限制,所以本能地)并且工作没有任何问题.
My own sample did that (instinctively since I learned the reentrancy limitation recently) and works without any issue.