zoukankan      html  css  js  c++  java
  • [OC] UITabBarController

    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;
    }
  • 相关阅读:
    多态
    重载 特点
    java 测量运行时间 单位:毫秒
    java 源代码 二分查找 Arrays
    java 同步 synchronized
    云服务器,价格其实不便宜,但为什么还要用呢
    网站访问优化(二):开启apache服务器gzip压缩
    CXF整合Spring开发WebService
    网站访问优化,未完待续
    网站访问优化,未完待续
  • 原文地址:https://www.cnblogs.com/webglcn/p/5090162.html
Copyright © 2011-2022 走看看