- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil] autorelease];
} else {
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil] autorelease];
}
CustomView1 *CustomView = [[CustomView1 alloc]initWithFrame:[[UIScreen mainScreen] bounds]];
self.viewController.view = CustomView;
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
これは私がCustomView
からrootViewcontroller
の表示を変更したい、と上記のコードを試してみましたが、背景色が黒とタッチイベントが受け入れられなかった残っAppDelegate.mrootViewControllerのビューを変更するには?
に表示されます。
どこがエラーですか?
ワンダフル! ^^。あなたの提案は正しく機能します。 –
アドバイスありがとうございます(サイドノード) –