UIWebView leaking

前端 未结 2 643
忘了有多久
忘了有多久 2020-12-18 16:36

I have a class that extends UIViewController and implements the UIWebViewDelegate, like this:

@interface TableViewController : UIViewController 

        
2条回答
  •  太阳男子
    2020-12-18 16:43

    Along with setting the webView delegate to nil, you should ask your webView to stop loading. Add the following lines of code and then try:

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

提交回复
热议问题