I was trying to create a tab bar based application from scratch but I’m having some issues. Basically I have my AppDelegate.h, AppDelegate.m and a MainView.xib. In the the .h file I have:
@interface AppDelegate : UIResponder <UIApplicationDelegate, UITabBarControllerDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) IBOutlet UITabBarController *tabBarController;
@end
In My .m I have:
@synthesize window = _window;
@synthesize tabBarController = _tabBarController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
}
And in my xib file I have my files owner as a class of Appdelegate and I have my outlet from there hooked up with a Tab Bar Controller. The problem is that my controller is returning null and thus isn’t being set as the rootViewController. What step/idea am I missing in setting up my app? Thanks in advance!
EDIT FIXED: Since I was starting from a empty application I didn’t have ‘Main nib file base name’ set, so I just had to set it to the nib I was trying to load.
Since I was starting from a empty application I didn’t have ‘Main nib file base name’ set, so I just had to set it to the nib I was trying to load.