zoukankan      html  css  js  c++  java
  • ios开发载入viewcontroller的几种方式

    Assuming you have storyboard, go to storyboard and give your VC an identifier (inspector), then do:

    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
    UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"IDENTIFIER"];
    [self.navigationController pushViewController:vc animated:YES];

    Assuming you have a xib file you want to do:

    UIViewController *vc = [[UIViewController alloc] initWithNibName:@"NIBNAME" bundle:nil];
    [self.navigationController pushViewController:vc animated:YES];

    Without a xib file:

    UIViewController *vc = [[UIViewController alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
  • 相关阅读:
    jquery调用click事件的三种方式
    jstl标签设置通用web项目根路径
    大于等于0小于等于100的正数用正则表达式表示
    Codeforces Round #319 (Div. 1) C. Points on Plane 分块
    Codeforces Codeforces Round #319 (Div. 2) C. Vasya and Petya's Game 数学
    Codeforces Codeforces Round #319 (Div. 2) B. Modulo Sum 背包dp
    Codeforces Codeforces Round #319 (Div. 2) A. Multiplication Table 水题
    cdoj 383 japan 树状数组
    bzoj 1800: [Ahoi2009]fly 飞行棋 暴力
    BZOJ 1452: [JSOI2009]Count 二维树状数组
  • 原文地址:https://www.cnblogs.com/neozhu/p/2800699.html
Copyright © 2011-2022 走看看