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];
  • 相关阅读:
    SSD5_Optional Exercise 5分析
    SSD5_Optional Exercise 3分析
    SSD5_Optional Exercise 1 分析
    SSD5_Optional Exercise 4不会
    SSD5_ Exercise 2分析
    SSD5_Optional Exercise 2分析
    SSD5_Exercise 3分析
    SSD5_Recommended Exercise 4 分析
    2013蓝桥杯C语言本科组B
    hdu 1316 How Many Fibs?【JAVA大数】
  • 原文地址:https://www.cnblogs.com/neozhu/p/2800699.html
Copyright © 2011-2022 走看看