EXC_BAD_ACCESS in UIWebView

后端 未结 5 860
囚心锁ツ
囚心锁ツ 2020-12-23 10:05

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:  EX         


        
5条回答
  •  一向
    一向 (楼主)
    2020-12-23 10:50

    The scenario goes something like this:

    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...

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

提交回复
热议问题