1. New CocoaTouch class -> Select Objective C -> named RootViewController

2. Disable APC error.

3. Open AppDelegate.m file and edit as below.

#import "AppDelegate.h"
#import "RootViewController.h" @interface AppDelegate () @end @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch.
RootViewController *rootVC = [[RootViewController alloc] init];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController: rootVC];
[rootVC release]; navController.title = @"ShouYe";
UIViewController *vc1 = [[UIViewController alloc] init];
vc1.title = @"ShouCang";
UIViewController *vc2 = [[UIViewController alloc] init];
vc2.title = @"SouSuo";
UIViewController *vc3 = [[UIViewController alloc] init];
vc3.title = @"Wo"; NSArray *controllers = [NSArray arrayWithObjects:navController, vc1, vc2, vc3, nil]; [navController release];
[vc1 release];
[vc2 release];
[vc3 release]; UITabBarController *tabBarController = [[UITabBarController alloc] init];
tabBarController.viewControllers = controllers; self.window.rootViewController = tabBarController;
[tabBarController release]; return YES;
}

[OC] UITabBarController的更多相关文章

  1. iOS开发——实战OC篇&环境搭建之Xib(玩转UINavigationController与UITabBarController)

    iOS开发——实战OC篇&环境搭建之Xib(玩转UINavigationController与UITabBarController)   前面我们介绍了StoryBoard这个新技术,和纯技术 ...

  2. iOS开发——实战OC篇&环境搭建之纯代码(玩转UINavigationController与UITabBarController)

    iOS开发——实战OC篇&环境搭建之纯代码(玩转UINavigationController与UITabBarController)   这里我们就直接上实例: 一:新建一个项目singleV ...

  3. OC中UITabBarController控制器

    UITabBarController UITabBarController(记为O)常用于管理多个导航控制器,例如有ABC三个导航控制器,可以:addChildViewController(记为A), ...

  4. iOS开发——实战OC篇&环境搭建之StoryBoard(玩转UINavigationController与UITabBarController)

      环境搭建之StoryBoard(玩转UINavigationController与UITabBarController)   研究了这么就IOS开发,都没有所处一个像样或者自己忙一点的项目.最近自 ...

  5. iOS开发——控制器OC篇&UINavigationController&UITabBarController详解

    UINavigationController&UITabBarController详解 一:UINavigationController 控制器的属性: UINavigationControl ...

  6. OC和Swift中的UITabBar和UINaviGationBar的适配 [UITabbar在IPad中的适配]

    作者 sundays http://www.cnblogs.com/sundaysgarden/ OC中UITabbar的适配[iphoneX和Ipad适配] 自定可以UITabar 自定义UITab ...

  7. iOS - 基础知识总结(OC版) 面试必看 再不看就要用swift了

    OC的理解与特性 OC作为一门面向对象的语言,自然具有面向对象的语言特性:封装.继承.多态.它既具有静态语言的特性(如C++),又有动态语言的效率(动态绑定.动态加载等).总体来讲,OC确实是一门不错 ...

  8. iOS代码规范(OC和Swift)

    下面说下iOS的代码规范问题,如果大家觉得还不错,可以直接用到项目中,有不同意见 可以在下面讨论下. 相信很多人工作中最烦的就是代码不规范,命名不规范,曾经见过一个VC里有3个按钮被命名为button ...

  9. 用C语言封装OC对象(耐心阅读,非常重要)

    用C语言封装OC对象(耐心阅读,非常重要) 本文的主要内容来自这里 前言 做iOS开发的朋友,对OC肯定非常了解,那么大家有没有想过OC中NSInteger,NSObject,NSString这些对象 ...

随机推荐

  1. openstack 创建虚拟机

    http://blog.csdn.net/tantexian/article/details/44595885#comments

  2. graylog2 架构--转载

    原文地址:http://docs.graylog.org/en/latest/pages/architecture.html Architectural considerations There ar ...

  3. Starship Troopers

    Problem Description You, the leader of Starship Troopers, are sent to destroy a base of the bugs. Th ...

  4. Android(java)学习笔记108:通过反射获取私有构造方法并且使用

    反射获取私有构造方法并且使用: 1.获取字节码文件.class对象:          Class c = Class.forName("cn.itcast_01.Person") ...

  5. cocos2d-x——在一个cpp中展示多个场景

    //20秒后自动运行下一个场景 runAction( CCSequence::create(CCDelayTime::create(20.0f), CCCallFunc::create(this, c ...

  6. 移动互联网(APP)产品设计的经验分享【转】

    随着移动互联网的发展,越来越多的Web产品开始布局移动端,因此最近经常碰到PM们在交流讨论移动APP产品的设计.我从事移动互联网已经有一年多了,通过不断的学习和实践也积累了一些心得,今天整理并分享一下 ...

  7. JSONP与JSON的关系

    这篇文章<说说JSON和JSONP,也许你会豁然开朗>写得非常棒,推荐一下 http://kb.cnblogs.com/page/139725/ (大神,对不起,我记录一下,因为你写的真得 ...

  8. 关于环信的WebIm的SDK一些使用注意

    先打自己几下脸,不好好看接口文档,啪啪啪. 主要先说下回调,直接先copy文档的 conn.listen({ onOpened: function ( message ) { //连接成功回调 //以 ...

  9. 使用Hibernate框架技术时,对项目进行的配置

    1.在需要使用Hibernate框架技术的项目上单击鼠标右键,在弹出的菜单中选择MyEclipse-->Add Hibernate Capabilities,打开Add Hibernate Ca ...

  10. 阿里云ubuntu搭建SVN服务器

    系统:Ubuntu 14.04 64位 新手注意:连接到服务器之后,默认会在用户文件夹位置“~”,使用cd /命令可以回到根目录.SVN搭在公共的位置比较稳妥. 1.通过apt-get安装subver ...