2012-02-29 12 views

答えて

-3

UINavigationController pushViewController:アニメーション:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    // ... 
    UIViewController *myViewController = [[UIViewController alloc] init]; 
    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:myViewController]; 
    self.window.rootViewController = navigationController; 
    // ... 
} 

あなたはmyViewControllerのクラスを置き換えることができ、および/またはあなたがしたい場合はペン先を使用し、それを初期化します。

8

あなたは次のようにそれを行うことができます。

1
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 


    UINavigationController *nav=[[UINavigationController alloc]initWithRootViewController:[[OptionViewController alloc]initWithNibName:@"OptionViewController" bundle:nil]]; 
    self.window.rootViewController=nav; 

    self.window.backgroundColor = [UIColor grayColor]; 
    [self.window makeKeyAndVisible]; 
    return YES; 
} 
0

それは私のために働いています:

がウィンドウ上で、あなたのtabviewcontrollerを設定し、それが正常に動作します。

UIWindow *window = [UIApplication sharedApplication].keyWindow; 
     UITabBarController *tabVC = [self.storyboard instantiateViewControllerWithIdentifier:@"MyMainView"]; 

     [window setRootViewController:tabVC]; 
関連する問題