私はUITabBarControllerを作るために以下のコードを使用しました:
AppDelegate.h
の内部:
IBOutlet UITabBarController *rootController;
...
@property (nonatomic, retain) IBOutlet UITabBarController *rootController;
AppDelegate.m内
@synthesize rootController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//Override point for customization after application launch.
[self.window addSubview:rootController.view];
[self.window makeKeyAndVisible];
return YES;
}
今私はAppDelegate内でこのメソッドを実装する方法を知る必要があります:
- (void)SwitchToTab:(int)index{
//go to tabview 1 or 2 ...
}