I have a problem with memory management.
I am developing an application that makes heavy use of UIWebView. This app generates dynamically lots of UIWebViews while lo
If you add multiple subviews within the same instance of a viewcontroller, you must remove the old subview from the superview before you add a new subview.
Add a tag to the UIWebView before you add it as a subview:
webView.tag = 10;
[self.view addSubview:webView];
webView = nil;
Before you add the new webview(this will clear the old view), remove the subview from the superview:
UIWebView * oldWebView = (UIWebView *)[self.view viewWithTag:10];
[oldWebView removeFromSuperview];
If you don´t remove the old webviews from the superview, they will build up in memory until you release the viewcontroller.