MyWebViewController.h
#import <UIKit/UIKit.h>
@interface MyWebViewController : UIViewController <UIWebViewDelegate> {
UIWebView *webView;
}
@end
MyWebViewController.m
#import "MyWebViewController.h"
@implementation MyWebViewController
- (void)loadView {
self.view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
webView = [[UIWebView alloc] initWithFrame:[self.view frame]];
[webView setDelegate:self];
[self.view addSubview: webView];
}
- (void)viewDidLoad {
[super viewDidLoad];
[webView loadRequest:[NSURLRequest requestWithURL:
[NSURL URLWithString:@"http://www.google.co.jp"]]];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIDeviceOrientationLandscapeRight);
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
- (void)dealloc {
[super dealloc];
[webView release];
}
@end