Does UIWebView leak memory?

前端 未结 4 1064
陌清茗
陌清茗 2020-12-03 06:05

If your iPhone app uses a UIWebView, and loads many pages with large images, you may find that you are leaking memory. Can this be resolved?

4条回答
  •  时光说笑
    2020-12-03 06:16

    I did this and it seems to help (looking at Leaks and running through simulator anyway):

    MyWebViewController *myWebViewController = [[[MyWebViewController alloc] initWithNibName:@"MyWebView" bundle:[NSBundle mainBundle]] autorelease];
    

    It was the "autorelease" that seems to help in that the leak is not getting bigger on each webview I open.

提交回复
热议问题