{"id":1678,"date":"2017-08-29T23:14:47","date_gmt":"2017-08-29T15:14:47","guid":{"rendered":"http:\/\/www.ouvps.com\/?p=1678"},"modified":"2017-08-29T23:14:47","modified_gmt":"2017-08-29T15:14:47","slug":"ios-wkwebview-%e6%8a%a5%e9%94%99-kcfrunloopcommonmodes","status":"publish","type":"post","link":"https:\/\/eepu.top\/?p=1678","title":{"rendered":"iOS WKWebView \u62a5\u9519 kCFRunLoopCommonModes"},"content":{"rendered":"<p>\u8bb0\u5f55\u4e00\u4e0b\u4f7f\u7528WKWebView\u4e2d\u9047\u5230\u7684\u4e00\u4e2a\u4f4e\u7ea7\u9519\u8bef\u3002\u5728APP\u5185\u4f7f\u7528WKWebView\u5c01\u88c5\u4e86\u4e00\u4e2a\u7b80\u5355\u7684BrowserViewController\uff0c\u628aBrowserViewController\u4f5c\u4e3a\u5176\u4ed6\u63a7\u5236\u5668\u7684\u5b50\u63a7\u5236\u5668\u7684\u65f6\u5019\u4e00\u5207\u6b63\u5e38\uff0c\u4f46\u662f\u5355\u72ec\u628aBrowserViewController push\u51fa\u6765\u7684\u65f6\u5019\u5c31\u4f1a\u62a5\u4e0b\u9762\u7684\u9519\u8bef\u3002\u6392\u67e5\u534a\u5929\u539f\u6765\u662f\u4e00\u4e2a\u975e\u5e38\u4f4e\u7ea7\u7684\u9519\u8bef\u3002<\/p>\n<pre lang='objc'>\n\u201cinvalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug. This message will only appear once per execution.\nlibc++abi.dylib: terminate_handler unexpectedly threw an exception\u201d\n<\/pre>\n<p>WKWebView\u7684\u4ee3\u7406\u65b9\u6cd5<\/p>\n<pre lang='objc'>\n- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler\n<\/pre>\n<p> \u4e2d\uff0c\u5fc5\u987b\u8c03\u7528decisionHandler\uff0c\u5426\u5219\u5c31\u4f1a\u51fa\u9519\u3002<\/p>\n<p>\u6bd4\u5982\uff1a<\/p>\n<pre lang='objc'>\n- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {\n\n    decisionHandler(WKNavigationActionPolicyAllow);\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u8bb0\u5f55\u4e00\u4e0b\u4f7f\u7528WKWebView\u4e2d\u9047\u5230\u7684\u4e00\u4e2a\u4f4e\u7ea7\u9519\u8bef\u3002\u5728APP\u5185\u4f7f\u7528WKWebView\u5c01\u88c5\u4e86\u4e00\u4e2a\u7b80\u5355\u7684Brows [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[44],"tags":[],"_links":{"self":[{"href":"https:\/\/eepu.top\/index.php?rest_route=\/wp\/v2\/posts\/1678"}],"collection":[{"href":"https:\/\/eepu.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eepu.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eepu.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eepu.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1678"}],"version-history":[{"count":0,"href":"https:\/\/eepu.top\/index.php?rest_route=\/wp\/v2\/posts\/1678\/revisions"}],"wp:attachment":[{"href":"https:\/\/eepu.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eepu.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eepu.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}