У меня есть эта проблема. У меня есть вкладка, созданная в appDelegate:
RootViewController *controller = [[RootViewController alloc] initWithNibName:@"RootView" bundle:nil];
UINavigationController *rootNavigationController = [[UINavigationController alloc] initWithRootViewController:controller];
[другие контроллеры инициализированы...]
self.tabController = [[UITabBarController alloc] init];
self.tabController.viewControllers = [NSArray arrayWithObjects:rootNavigationController,secondController,thirdController, nil];
Теперь, когда в RootViewController я пытаюсь назначить изображение на tabBar:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.tabBarItem.image = [UIImage imageNamed:@"tabRoot.png"];
self.tabBarItem.title = @"Root";
}
Но ничего не отображается, почему? Странно то, что если я делаю то же самое, но без навигационного контроллера, изображение отображается правильно.