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];
  • 相关阅读:
    iOS-AVPlayer
    简单认识一下什么是闭包
    你珍惜一个人,一定是感动过
    用户关闭浏览器页器,弹出一个提示
    Html5 小球键盘移动
    HTML坦克大战学习01
    關於 WebClient wc = new WebClient() 下載第三方數據不能進安安信任異常
    封装自己的yQuery
    js彈出層或者js彈出引用url Frame 層
    动态创建表单模拟提交
  • 原文地址:https://www.cnblogs.com/neozhu/p/2800699.html
Copyright © 2011-2022 走看看