WindowベースアプリとViewベースアプリの違いは、Viewベースアプリの場合は、ViewControllerを使用している点です。
WindowAppDelegate.h
@interface WindowAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; } @property(nonatomic, retain) IBOutlet UIWindow *window; @end
ViewAppDelegate.h
@class ViewAppViewController; @interface ViewAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; ViewAppController *viewController; } @property(nonatomic, retain) IBOutlet UIWindow *window; @property(nonatomic, retain) IBOutlet ViewAppViewController *viewController; @end
ViewAppViewController.m
-(BOOL)application:(UIApplication *)allication didFinishLanchingWithOptions:(NSDictionary *)lanchOptions{ [window addSubview:viewController.view]; [window makeKeyAndVisible]; return YES; } -(void)dealloc{ [viewController release]; [window release]; [super dealloc]; }