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

WindowベースアプリとViewベースアプリの違いは、Viewベースアプリの場合は、ViewControllerを使用している点です。

WindowAppDelegate.h
[c]
@interface WindowAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
}
@property(nonatomic, retain) IBOutlet UIWindow *window;
@end
[/c]

ViewAppDelegate.h
[c]
@class ViewAppViewController;
@interface ViewAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
ViewAppController *viewController;
}
@property(nonatomic, retain) IBOutlet UIWindow *window;
@property(nonatomic, retain) IBOutlet ViewAppViewController *viewController;
@end
[/c]

ViewAppViewController.m
[c]
-(BOOL)application:(UIApplication *)allication didFinishLanchingWithOptions:(NSDictionary *)lanchOptions{
[window addSubview:viewController.view];
[window makeKeyAndVisible];
return YES;
}
-(void)dealloc{
[viewController release];
[window release];
[super dealloc];
}
[/c]

This entry was posted in Objective-C, 技術情報. Bookmark the permalink.

コメントを残す

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