MonoTouch:加载网页后调用 UIWebView.LoadHTMLString [英] MonoTouch: Calling UIWebView.LoadHTMLString Once Web Page is Loaded

查看:19
本文介绍了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 LoadHtmlStringis 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.

这篇关于MonoTouch:加载网页后调用 UIWebView.LoadHTMLString的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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