当前位置:首页 > 操作系统 > Ios

ios手写代码添加控制器

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

{

    // 1.创建window

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

 

    // 2.设置window的背景色

    self.window.backgroundColor = [UIColor whiteColor];

    

    MyOneViewController *one = [[MyOneViewController alloc] init];

//    [self.window addSubview:one.view];

    self.window.rootViewController = one;

 

    // 3.显示window

    [self.window makeKeyAndVisible];

    return YES;

}

 

原文:http://www.cnblogs.com/nianzhilian/p/4923013.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!