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];
  • 相关阅读:
    64位平台支持大于2 GB大小的数组
    NET Framework 4.5新特性 数据库的连接加密保护。
    永无止境之网站的伸缩性架构
    ASP.NET MVC IOC 之Ninject攻略
    C# 中几个小“陷阱”
    AngularJS的依赖注入方式
    JVM内存配置详解(转)
    StringBuilder、StringBuffer和String三者的联系和区别(转)
    Java线程的生命周期(转)
    Java程序员须知的七个日志管理工具(转)
  • 原文地址:https://www.cnblogs.com/neozhu/p/2800699.html
Copyright © 2011-2022 走看看