I'm creating a Tabbed Application, and I'm having some trouble getting my icons to show up on the tabs. I've compared my code to a previous example I had worked on out of the book, and it seems to match, but the icons in the new application just show up as blank squares. I've tried to include all the relevant code without all the fiddly bits, but if you'd like to see more, just ask, and I'll edit more in as the need dictates. I've already checked that the case is identical on the imageNamed:string and the icon name.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
... // initializers for ViewControllers 1-3, which are custom viewControllers
// that have the tab properties set in (void)viewDidLoad
globalUINavigationController = [[UINavigationController alloc] initWithNibName:
@"DemoTabbedFourthViewController" bundle:nil];
globalUINavigationController.title = NSLocalizedString(@"Fourth", @"Fourth");
globalUINavigationController.tabBarItem.image = [UIImage imageNamed:@"fourth.png"];
UIViewController *viewController4 = [[DemoTabbedFourthViewController alloc]
initWithNibName:@"DemoTabbedFourthViewController" bundle:nil];
[globalUINavigationController pushViewController:viewController4 animated:YES];
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2,
viewController3, globalUINavigationController, nil];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
}
I'm using the globalUINavigationController as my example, because if I can get that one working, I should be able to get the others working based on it. If you have any questions or comments about the code, let me know. I'm new to Objective C and iPhone App development, and I'll take all the help I can get.