1. <small id='c1LVU'></small><noframes id='c1LVU'>

    <tfoot id='c1LVU'></tfoot>

      <bdo id='c1LVU'></bdo><ul id='c1LVU'></ul>

  2. <legend id='c1LVU'><style id='c1LVU'><dir id='c1LVU'><q id='c1LVU'></q></dir></style></legend>

    <i id='c1LVU'><tr id='c1LVU'><dt id='c1LVU'><q id='c1LVU'><span id='c1LVU'><b id='c1LVU'><form id='c1LVU'><ins id='c1LVU'></ins><ul id='c1LVU'></ul><sub id='c1LVU'></sub></form><legend id='c1LVU'></legend><bdo id='c1LVU'><pre id='c1LVU'><center id='c1LVU'></center></pre></bdo></b><th id='c1LVU'></th></span></q></dt></tr></i><div id='c1LVU'><tfoot id='c1LVU'></tfoot><dl id='c1LVU'><fieldset id='c1LVU'></fieldset></dl></div>

      UIWebView EXC_BAD_ACCESS 崩溃

      UIWebView EXC_BAD_ACCESS crash(UIWebView EXC_BAD_ACCESS 崩溃)
        <bdo id='Ns3Cx'></bdo><ul id='Ns3Cx'></ul>
          <tbody id='Ns3Cx'></tbody>
        <legend id='Ns3Cx'><style id='Ns3Cx'><dir id='Ns3Cx'><q id='Ns3Cx'></q></dir></style></legend>

        1. <small id='Ns3Cx'></small><noframes id='Ns3Cx'>

          • <i id='Ns3Cx'><tr id='Ns3Cx'><dt id='Ns3Cx'><q id='Ns3Cx'><span id='Ns3Cx'><b id='Ns3Cx'><form id='Ns3Cx'><ins id='Ns3Cx'></ins><ul id='Ns3Cx'></ul><sub id='Ns3Cx'></sub></form><legend id='Ns3Cx'></legend><bdo id='Ns3Cx'><pre id='Ns3Cx'><center id='Ns3Cx'></center></pre></bdo></b><th id='Ns3Cx'></th></span></q></dt></tr></i><div id='Ns3Cx'><tfoot id='Ns3Cx'></tfoot><dl id='Ns3Cx'><fieldset id='Ns3Cx'></fieldset></dl></div>

                <tfoot id='Ns3Cx'></tfoot>
                本文介绍了UIWebView EXC_BAD_ACCESS 崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我遇到使用 UIWebView 的应用程序崩溃.通常是在页面没有完全加载并且 UIWebView 被发送 stopLoading 选择器的时候.或者当 UIWebView 完全加载页面时.我有 EXC_BAD_ACCESS.堆栈如下所示:

                I'm experiencing crashes of an app that uses UIWebView. Usually it's when page is not fully loaded and UIWebView is sent stopLoading selector. Or when UIWebView fully loaded page. I've got EXC_BAD_ACCESS. Stack looks like this:

                #0  0x95bb7688 in objc_msgSend
                #1  0x30a671db in -[UIWebView webView:decidePolicyForNavigationAction:request:frame:decisionListener:]
                #2  0x3024a10d in __invoking___
                #3  0x30249ff8 in -[NSInvocation invoke]
                #4  0x358ab160 in HandleDelegateSource
                #5  0x302452c1 in CFRunLoopRunSpecific
                #6  0x30244628 in CFRunLoopRunInMode
                #7  0x32044c31 in GSEventRunModal
                #8  0x32044cf6 in GSEventRun
                #9  0x309021ee in UIApplicationMain
                #10 0x0000239c in main at main.m:13
                

                对我来说最奇怪的是 webView:decidePolicyForNavigationAction:request:frame:decisionListener: 选择器发送到 UIWebView,因为在 UIWebView 文档中没有这样的选择器!仅适用于 Cocoa(不是 cocoa touch)WebView.我怀疑 UIWebView 或其委托有问题.但我无法设置断点来观看它们.请告知我在这种情况下如何获得更多信息.

                for me most strange thing here is webView:decidePolicyForNavigationAction:request:frame:decisionListener: selector sent to UIWebView, because there is no such selector in UIWebView documentation! Only for Cocoa (not cocoa touch) WebView. I suspect that there is something wrong with UIWebView or its delegate. But I can't set breakpoint to watch them. Please advise how I can get more info in this situation.

                推荐答案

                你必须在离开视图之前停止加载 webView 并移除委托:

                You have to stop loading the webView and remove the delegate before leaving the view:

                // ARC (correct solution)
                - (void)dealloc {
                    [_webView setDelegate:nil];
                    [_webView stopLoading];
                }
                
                // non ARC
                - (void)dealloc {
                    [webView setDelegate:nil];
                    [webView stopLoading];
                    [webView release];
                    [super dealloc];
                }
                
                // ARC (older solution)
                - (void)viewWillUnload {
                    [webView setDelegate:nil];
                    [webView stopLoading];
                }
                

                Apple 文档的内容是:重要提示在释放您已为其设置委托的 UIWebView 实例之前,您必须首先将其委托属性设置为 nil.例如,这可以在您的 dealloc 方法中完成.

                What Apple documentation is saying: Important Before releasing an instance of UIWebView for which you have set a delegate, you must first set its delegate property to nil. This can be done, for example, in your dealloc method.

                这篇关于UIWebView EXC_BAD_ACCESS 崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Getting an NSArray of a single attribute from an NSArray(从 NSArray 获取单个属性的 NSArray)
                ImageIO: lt;ERRORgt; JPEG Corrupt JPEG data: premature end of data segment iphone - how to catch this?(ImageIO:lt;错误gt;JPEG 损坏的 JPEG 数据:iphone 数据段过早结束 - 如何捕捉到这个?)
                Xcode iOS organizer submit to app store yields quot;The archive is invalidquot; error(Xcode iOS 管理器提交到应用商店产生“存档无效;错误)
                MFMessageComposeViewController alloc returns nil(MFMessageComposeViewController alloc 返回 nil)
                Mobile Device Management with iPhone(使用 iPhone 进行移动设备管理)
                iPhone: How to allow multiple selection in tabelview for a custom cell?(iPhone:如何允许在自定义单元格的表格视图中进行多项选择?)

                    <tfoot id='5OeJ1'></tfoot>
                        <tbody id='5OeJ1'></tbody>

                      <small id='5OeJ1'></small><noframes id='5OeJ1'>

                      <i id='5OeJ1'><tr id='5OeJ1'><dt id='5OeJ1'><q id='5OeJ1'><span id='5OeJ1'><b id='5OeJ1'><form id='5OeJ1'><ins id='5OeJ1'></ins><ul id='5OeJ1'></ul><sub id='5OeJ1'></sub></form><legend id='5OeJ1'></legend><bdo id='5OeJ1'><pre id='5OeJ1'><center id='5OeJ1'></center></pre></bdo></b><th id='5OeJ1'></th></span></q></dt></tr></i><div id='5OeJ1'><tfoot id='5OeJ1'></tfoot><dl id='5OeJ1'><fieldset id='5OeJ1'></fieldset></dl></div>

                      <legend id='5OeJ1'><style id='5OeJ1'><dir id='5OeJ1'><q id='5OeJ1'></q></dir></style></legend>

                          <bdo id='5OeJ1'></bdo><ul id='5OeJ1'></ul>