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

      <small id='nAsM4'></small><noframes id='nAsM4'>

      <legend id='nAsM4'><style id='nAsM4'><dir id='nAsM4'><q id='nAsM4'></q></dir></style></legend>

      1. <tfoot id='nAsM4'></tfoot>

        UIWebView 中的 EXC_BAD_ACCESS

        时间:2023-10-21
          <legend id='9Umba'><style id='9Umba'><dir id='9Umba'><q id='9Umba'></q></dir></style></legend>
          1. <i id='9Umba'><tr id='9Umba'><dt id='9Umba'><q id='9Umba'><span id='9Umba'><b id='9Umba'><form id='9Umba'><ins id='9Umba'></ins><ul id='9Umba'></ul><sub id='9Umba'></sub></form><legend id='9Umba'></legend><bdo id='9Umba'><pre id='9Umba'><center id='9Umba'></center></pre></bdo></b><th id='9Umba'></th></span></q></dt></tr></i><div id='9Umba'><tfoot id='9Umba'></tfoot><dl id='9Umba'><fieldset id='9Umba'></fieldset></dl></div>
              <tbody id='9Umba'></tbody>
                <bdo id='9Umba'></bdo><ul id='9Umba'></ul>

                  <small id='9Umba'></small><noframes id='9Umba'>

                  <tfoot id='9Umba'></tfoot>

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

                  问题描述

                  我刚刚从 iTunes Connect 下载了我的一个 iPhone 应用程序的崩溃报告.最常见的崩溃有如下痕迹:

                  I just downloaded the crash reports for one of my iPhone apps from iTunes Connect. The most common crash has a trace like the following:

                  Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
                  Exception Codes: KERN_INVALID_ADDRESS at 0xa1b1c1db
                  Crashed Thread:  0
                  
                  Thread 0 Crashed:
                  0   libobjc.A.dylib                 0x3030e6f4 objc_msgSend + 16
                  1   UIKit                           0x30ebebee -[UIWebView webView:resource:didFinishLoadingFromDataSource:]
                  2   UIKit                           0x30ebe5ca -[UIWebViewWebViewDelegate webView:resource:didFinishLoadingFromDataSource:]
                  3   CoreFoundation                  0x32b73b5c __invoking___ + 60
                  4   CoreFoundation                  0x32bc67be -[NSInvocation invoke]
                  5   WebCore                         0x320baa86 HandleDelegateSource
                  6   CoreFoundation                  0x32bb8a96 CFRunLoopRunSpecific
                  7   CoreFoundation                  0x32bb8356 CFRunLoopRunInMode
                  8   GraphicsServices                0x30544cd4 GSEventRunModal
                  9   GraphicsServices                0x30544d80 GSEventRun
                  10  UIKit                           0x30d2c768 -[UIApplication _run]
                  11  UIKit                           0x30d2b46c UIApplicationMain
                  

                  我大约 80% 确定这是 UIWebView 内部的问题,超出了我可以解决的范围.是否有人对如何缩小此问题范围以帮助确定它是操作系统和 UIWebView 的问题,还是我可以在我的代码中修复和解决的问题有任何建议?提前致谢.

                  I'm about 80% sure this is an issue internal to UIWebView and outside the scope of what I can address. Does anyone have any suggestions on how to narrow down this issue to help identify whether it's an issue with the OS and UIWebView, or an issue that I can fix and address in my code? Thanks in advance.

                  更新:有问题的 UIWebView 位于当用户点击相应导航控制器的后退按钮时释放的视图中.公认的解决方案似乎很好地解释了为什么会发生此错误.

                  UPDATE: The UIWebView in question is in a view that gets released when the user hits the back button of the corresponding navigation controller. The accepted solution seems to provide a good explanation for why this error is occurring.

                  建议解决方案之前:

                  - (void)dealloc {
                      [webView release];
                  
                      [super dealloc];
                  }
                  

                  建议解决方案后:

                  - (void)dealloc {
                      webView.delegate = nil;
                      [webView stopLoading];
                      [webView release];
                  
                      [super dealloc];
                  }
                  

                  推荐答案

                  场景是这样的:

                  1. 用户使用 UIWebView 进入屏幕.UIViewControllerself 设置为委托
                  2. 网页开始下载
                  3. 用户退出屏幕
                    3a.UIViewController 被释放
                  4. UIWebView 完成加载并向其委托发送我完成"消息...
                  1. User enters screen with UIWebView. The UIViewController sets self as the delegate
                  2. Web page starts downloading
                  3. User exits screen
                    3a. UIViewController gets deallocated
                  4. UIWebView finishes loading and sends "I finished" message to its delegate...

                  在解除分配委托之前,您需要停止 UIWebView 加载其页面并将其委托设置为 nil.

                  You need to stop the UIWebView from loading its page and sets its delegate to nil before you deallocate the delegate.

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

                  上一篇:UIWebView 在旋转后调整文本大小:寻找神奇错误或我的愚蠢的解释 下一篇:UIWebView 中的 MPMoviePlayerController 全屏电影

                  相关文章

                  <tfoot id='lxrjh'></tfoot>

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

                      • <bdo id='lxrjh'></bdo><ul id='lxrjh'></ul>
                    1. <small id='lxrjh'></small><noframes id='lxrjh'>

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