Unreproducible webcore crashes

后端 未结 2 825
轮回少年
轮回少年 2021-02-02 12:54

I\'ve got an iPad app that\'s in the App Store for around three months now and I\'ve been receiving some weird crash reports that I can\'t figure out. These are not that frequen

2条回答
  •  孤街浪徒
    2021-02-02 13:38

    I had exactly the same issue in an app I worked on, it weirdly only occurred on older devices running iOS 7. I suspect this has something to do with them not being able to keep up.

    What I had was a UITableView where one of the rows would open a UIViewController that had a UIWebView on it for custom adverts. What I found is that on the older devices objects and memory where being free'd up far more regularly than I'd seen in other platforms. I could mimic the crash very easily on an iPhone 4 by going in / out of the screen 2 or 3 times. Where as an iPhone 5 I spent 15 minutes doing the same and couldn't fault it.

    I know you may feel like your controller is not being dealloc'd but it really sounds as though it is or some reference is being dropped, I have also seen my delegate references disappear a few times in this app also.

    My advice and what worked for me is to stop the execution of the webview and set everything to nil when you can.

    In one instance on my app I chose to do it on the viewWillDisappear callback, because in my circumstance it was gone from the user and recreated later, so I blanked everything like so:

    [webView stopLoading];
    
    self.webView.delegate = nil;
    self.webView = nil;
    

提交回复
热议问题