今では動作します:
NativeAppDelegate.m
#import "NativeAppDelegate.h"
#import "NativeViewController.h"
@implementation NativeAppDelegate
@synthesize window;
@synthesize viewController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after app launch
[self.window setRootViewController:viewController];
return YES;
}
- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}
@end
NativeViewController.m
#import "NativeViewController.h"
@implementation NativeViewController
@synthesize webView;
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"login" ofType:@"html"];
NSData *htmlData = [NSData dataWithContentsOfFile:filePath];
if (htmlData) {
NSBundle *bundle = [NSBundle mainBundle];
NSString *path = [bundle bundlePath];
NSString *fullPath = [NSBundle pathForResource:@"login" ofType:@"html" inDirectory:path];
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:fullPath]]];
}
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[webView release];
[super dealloc];
}
@end
また、InterfaceBuilder の WebView で ScaleToFill のチェックを外しました。それ以外の場合は、ページをスクロールして Hello World を表示する必要がありました。
向きのメソッドを削除し、ウィンドウの RootviewController を ViewController に設定しました。ウィンドウに RootVieController がありませんでした。