zoukankan      html  css  js  c++  java
  • 从Empty Application新建项目

    新建一个Empty Application,再上面建一个viewController。

    1.新建一个Empty Application,只有一个appDelegate类。

    2.再新建一个group名叫first,在这个group下新建一个UIViewController的子类。

    3.添加代码

    在AppDelegate.h中添加代码:

    #import "firstViewController.h"


    @property (strong, nonatomic) firstViewController *fvc;

    在AppDelegate.m中添加代码:

    @synthesize fvc;

    在AppDelegate.m的didFinishLaunchingWithOptions函数中添加2句代码:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];
    self.fvc=[[firstViewController alloc ] initWithNibName:@"firstViewController" bundle:nil];//添加
    self.window.rootViewController=self.fvc;//添加
    [self.window makeKeyAndVisible];
    return YES;
    }

    这样就得到了一个有一个空白界面的程序。





  • 相关阅读:
    MySQL初始化以及更改密码
    对付小白的ARP的简单介绍
    PXE批量安装CentOS7操作系统
    20不惑
    辩论会
    学习
    JAVA语言的特点
    程序流程图对新手来说很重要。
    浅谈博客、微博与轻博客的区别与联系
    要学好JAVA要注意些什么?
  • 原文地址:https://www.cnblogs.com/phoenix13suns/p/2340391.html
Copyright © 2011-2022 走看看