WindowベースアプリとViewベースアプリ

2010年7月2日 Posted by PURGE

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];
}

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です