I created a TabBarController but their TabBarItems doesn't appears.
What am I doing wrong? Because Ive already added the tabBarItem of View Controllers, and they don't appears.
//Create Controllers
SBQNewsViewController *news=[[SBQNewsViewController alloc] initWithStyle:UITableViewStylePlain];
SBQFavoritesViewController *favs=[[SBQFavoritesViewController alloc] initWithStyle:UITableViewStylePlain];
//Create NavigationControllers
UINavigationController *newsNav=[[UINavigationController alloc] initWithRootViewController:news];
UINavigationController *favsNav=[[UINavigationController alloc] initWithRootViewController:favs];
//Create TabBarController
UITabBarController *tabReader=[[UITabBarController alloc] init];
tabReader.viewControllers=@[newsNav,favsNav];
self.window.rootViewController=tabReader;
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
And the tabBarItems added:
Into SBQNewsViewController:
#import "SBQNewsViewController.h"
@implementation SBQNewsViewController
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
self.tabBarItem.image = [UIImage imageNamed:@"Reportslc.png"];
self.tabBarItem.title = @"Noticias";
}
return self;
}
Into SBQFavoritesViewController:
#import "SBQFavoritesViewController.h"
@interface SBQFavoritesViewController ()
@end
static NSString *CellIdentifier=@"CellIdentifier";
@implementation SBQFavoritesViewController
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
self.tabBarItem.image = [UIImage imageNamed:@"Favoritelc.png"];
self.tabBarItem.title = @"Favoritos";
}
return self;
}