iOS程序初始化

1. 先初始化self.window

2. self.viewController

3. self.window.rootViewController

4. 显示, [self.window makeKeyAndVisible]


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    // Override point for customization after application launch.

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {

    self.viewController = [[OTViewController alloc] initWithNibName:@"OTViewController_iPhone" bundle:nil];

} else {

    self.viewController = [[OTViewController alloc] initWithNibName:@"OTViewController_iPad" bundle:nil];

}

self.window.rootViewController = self.viewController;

    [self.window makeKeyAndVisible];

    return YES;

}

阅读更多
个人分类: iOS
想对作者说点什么? 我来说一句

max232初始化程序

2009年05月29日 147B 下载

没有更多推荐了,返回首页

不良信息举报

iOS程序初始化

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭