UIWebViewを表示するためのシンプルなUIViewController

MyWebViewController.h

#import <UIKit/UIKit.h>

@interface MyWebViewController : UIViewController <UIWebViewDelegate> {
	UIWebView *webView;
}

@end

MyWebViewController.m

#import "MyWebViewController.h"

@implementation MyWebViewController

// Implement loadView to create a view hierarchy programmatically.
- (void)loadView {
	self.view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
	webView = [[UIWebView alloc] initWithFrame:[self.view frame]];
	[webView setDelegate:self];
	[self.view addSubview: webView];
}

// Implement viewDidLoad to do additional setup after loading the view.
- (void)viewDidLoad {
	[super viewDidLoad];
	[webView loadRequest:[NSURLRequest requestWithURL:
		[NSURL URLWithString:@"http://www.google.co.jp"]]];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIDeviceOrientationLandscapeRight);
}

- (void)didReceiveMemoryWarning {
	[super didReceiveMemoryWarning]; 
}

- (void)dealloc {
	[super dealloc];
	[webView release];
}

@end