i used the code below to make a UITabBarController :
inside AppDelegate.h:
IBOutlet UITabBarController *rootController;
...
@property (nonatomic, retain) IBOutlet UITabBarController *rootController;
inside 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;
}
Now i need to know how to implement this method inside AppDelegate:
- (void)SwitchToTab:(int)index{
//go to tabview 1 or 2 ...
}
You can do this:
or this:
See the UITabBarController reference page for details.