2011-07-28 5 views
0

良い一日に接続されているのUIViewControllerをトリガみんな、私はタブ付きナビゲーションのためのUITabBarControllerを持つアプリケーションが...ビュー・コントローラはURLを経由して、それぞれのTabItemsにマッピングされている あなたにUITabBarItem

、ちょうどThree20のTTNavigationSample Appと同じです。

私の問題は、私のビューコントローラ内には、TabItemにも接続されている別のビューコントローラを呼び出すボタンがあります。私がボタンをトリガーすると、アプリケーションはエラーを投げます。どうすれば解決できますか?私のTabBarController、私はviewDidLoadメソッド内でこれを持って

-(void)viewDidLoad { 
[self setTabURLs: [NSArrayWithObjects: 
        @"tt://bulletinBoard", 
        @"tt://contacts", 
        nil 
        ]]; 
} 
+0

あなたはどのようなエラーが出るのですか?通常、あなたが試しているシナリオは... – tipycalFlow

答えて

0

サンプル.mファイル

#import "HabBarController.h" 


@implementation TabBarController 


- (void)viewDidLoad { 

    //these are variables like "tt/feed" 
    [self setTabURLs:[NSArray arrayWithObjects: 
         kAppFeedURLPath, 
         kAppHotURLPath, 
         kAppPostPhotoURLPath, 
         kAppGeneralActivityURLPath, 
         nil]]; 


} 

- (UIViewController*)rootControllerForController: 
(UIViewController*)controller { 

    if ([controller canContainControllers]) { 

     return controller; 
    } else { 
     UINavigationController* navController = [[[UINavigationController 
                alloc] init] autorelease]; 
     [navController pushViewController:controller animated:NO]; 
     return navController; 
    } 
} 


- (void)viewWillDisappear:(BOOL)animated { 
    [super viewWillDisappear:animated]; 
    [self.tabBarController.navigationController setNavigationBarHidden:YES animated:NO]; 

} 
- (void)didReceiveMemoryWarning { 

    [super didReceiveMemoryWarning]; 


} 

- (void)viewDidUnload { 
    [super viewDidUnload]; 
} 


- (void)dealloc { 
    [super dealloc]; 
} 

@end 
関連する問題