I am adding UITabBarController in my IPhone application.I hav mentioned it in my TabsAppDelegate.h like this
#import <UIKit/UIKit.h>
@interface TabsAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> {
UIWindow *window;
UITabBarController *tabBarController;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;
@end
and my TabsAppDelegate.m didFinishLaunchingWithOptions method
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions {
// Add the tab bar controller's view to the window and display.
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
return YES;
}
Now in MainWindow.xib i added Tab Bar controller and make connection with tabBarController.
And later i created FirstViewController and SeconViewController which are two ViewControllers.
Now at first tab i added my FirstViewController.xib and on second tab i added SecondViewController.xib file using builder interface.
But when i run the project it shows black screen.
Need your help.
Thanks in advance.
try this you just forgot to add rootViewController