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];
  • 相关阅读:
    mojoportal学习——文章翻译之超过3个内容面板
    mojoportal学习——文章翻译之mojoportal的皮肤模板
    mojoportal中替换第一层菜单中的连接为空连接
    mojoportal学习——文章翻译之不同的模块使用不同的风格
    mojoportal学习——文章翻译之layout.master文件
    mojoportal学习——文章翻译之mojoportal高级功能之菜单子站点化
    GridView选中行变色(无刷新)
    页面之间传递参数的几种方法荟萃
    ASP.NET程序中常用的三十三种代码(一)
    ASP.NET设计应用程序的七大绝招
  • 原文地址:https://www.cnblogs.com/neozhu/p/2800699.html
Copyright © 2011-2022 走看看