A few improvements for your code:
- (void)viewDidLoad { [super viewDidLoad]; UIWebView *webview = [[UIWebView alloc] initWithFrame:CGRectMake(self.view.bounds)]; [webView setBackgroundColor:[UIColor whiteColor]]; [self.view addSubview: webView]; [webview release], webview = nil; }
In general, you should find this approach less fragile.
PS. If you keep a link to the UIWebView around, be sure to release it at - viewDidUnload .
source share