2012-05-11 18 views
0

xmlファイルに複数のファイルが含まれている場合は、私のアプリケーションをチェックインしています。もしそうでなければ、viewcontrollerを他のviewcontrollerに自動的にプッシュしたいと思います。自動的にプッシュする方法

私は今これをやっていますが、動作しますが、

私はやってこれを行うには、通常、私は(ViewControllerOne)に押してるものに最初のViewControllerからのデータを送信する必要が
UIViewController *rootController = [[ViewControllerOne alloc] initWithNibName:@"ViewControllerOne" bundle:nil]; 

navigationController = [[UINavigationController alloc] initWithRootViewController:rootController]; 

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 
[self.window addSubview:navigationController.view]; 
[self.window makeKeyAndVisible]; 

:私はこのコードをcombinateしたい

ViewControllerthree *Controller = [[ViewControllerthree alloc] initWithNibName:@"ViewControllerthree" bundle:[NSBundle mainBundle]]; 

Controller.Title = [item objectForKey:@"Title"]; 
[self.navigationController pushViewController:Controller animated:YES]; 
Controller = nil; 

をViewControllerに2つのものが含まれている場合、コントローラーをリダイレクトできます。ビューコントローラーに表示されているバックボタンを使わずにプッシュする必要があります。

+2

私はあなたの質問を理解していません。投稿したコードがあなたの質問に関係していないようですね? – onnoweb

+0

Dismissing時にView Controllerをスキップしますか? Cから戻ってBをバイパスしてAに戻ることができますか?もしそうなら、これを見てください:http://stackoverflow.com/questions/2944191/iphone-dismiss-multiple-viewcontrollers – vikingosegundo

答えて

2

LOLが答えのthats!答えを投稿したばかりです。

ViewControllerthree *Controller = [[ViewControllerthree alloc] initWithNibName:@"ViewControllerthree" bundle:[NSBundle mainBundle]]; 

    Controller.Title = [item objectForKey:@"Title"]; 
UIViewController *rootController = 
    [[ViewControllerOne alloc] 
    initWithNibName:@"ViewControllerOne" bundle:nil]; 

    navigationController = [[UINavigationController alloc] 
          initWithRootViewController:rootController]; 

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 
    [self.window addSubview:navigationController.view]; 
    [self.window makeKeyAndVisible]; 
[self.navigationController pushViewController:Controller animated:YES]; 
    Controller = nil; 

そしてvoila!

グッドラック、 ネイサン

0

「戻る」ボタンがない場合、あなたはUIViewControllerを却下しますか?

は、 "戻る" ボタンは、以下の使用非表示にするには:

self.navigationItem.hidesBackButton = YES; 
関連する問題