1
我發現當web視圖已經發布時,我的應用程序會保存很多內存。因爲我的應用程序需要加載很多網頁。這是我在dealloc方法中調用的發佈函數。如何釋放可可web視圖的內存?
[[NSURLCache sharedURLCache] removeAllCachedResponses];
[[_webView mainFrame] loadHTMLString:@"" baseURL:nil];
[_webView stopLoading:nil];
[_webView removeFromSuperview];
[_webView setResourceLoadDelegate:nil];
[_webView setFrameLoadDelegate:nil];
[_webView release];
_webView = nil;
但當做this.It仍有許多內存爲holder.What的我應該做的有沒有發生?
我已經使用過儀器,沒有發現內存泄漏。我創建了可可webview的類並添加了一個cealrForDealloc函數。內存泄漏看起來像一個輕鬆的改進。 – gohamgx