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

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





  • 相关阅读:
    Matrix Power Series
    The Noisy Party(BUPT)
    cony
    又见Fibonacci数列
    回文字符串
    街区最短路径问题
    点的变换
    可恶的麦兜(北邮)
    Travel
    Swing实现Java代码编辑器实现关键词高亮显示
  • 原文地址:https://www.cnblogs.com/phoenix13suns/p/2340391.html
Copyright © 2011-2022 走看看