Im trying to use this tab bar view controller but am having difficulties getting it to load my view controllers.
I have followed their demo filling in my view controllers for theirs but all I get are black views (probably nil?). I have setup a breakpoint and the self.tabBarItems is filled with my view controllers from the best I can tell. Meaning that if I give it 2 view controllers the count is two but I am unable to see further details:

see how tabBarItems has 2 objects but that even with the drop down arrow clicked nothing is listed?
Anyways the code is pretty simple.
My code:
- (void)setup {
// Set View Frame
self.viewFrame = (CGRect){CGPointZero, {kKYViewWidth, kKYViewHeight}};
// Add child view controllers to each tab
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
_salesViewController = [[SalesViewController alloc] initWithNibName:@"SalesViewController_iPhone" bundle:nil];
_customersViewController = [[CustomersViewController alloc] initWithNibName:@"CustomersViewController_iPhone" bundle:nil];
_itemsViewController = [[ItemsViewController alloc] initWithNibName:@"ItemsViewController_iPhone" bundle:nil];
_employeesViewController = [[EmployeesViewController alloc] initWithNibName:@"EmployeesViewController_iPhone" bundle:nil];
_settingsViewController = [[SettingsViewController alloc] initWithNibName:@"SettingsViewController_iPhone" bundle:nil];
} else {
_salesViewController = [[SalesViewController alloc] initWithNibName:@"SalesViewController_iPad" bundle:nil];
_customersViewController = [[CustomersViewController alloc] initWithNibName:@"CustomersViewController_iPad" bundle:nil];
_itemsViewController = [[ItemsViewController alloc] initWithNibName:@"ItemsViewController_iPad" bundle:nil];
_employeesViewController = [[EmployeesViewController alloc] initWithNibName:@"EmployeesViewController_iPad" bundle:nil];
_settingsViewController = [[SettingsViewController alloc] initWithNibName:@"SettingsViewController_iPad" bundle:nil];
}
// Set child views' Frame
CGRect childViewFrame = self.viewFrame;
[_salesViewController.view setFrame:childViewFrame];
[_customersViewController.view setFrame:childViewFrame];
[_itemsViewController.view setFrame:childViewFrame];
[_employeesViewController.view setFrame:childViewFrame];
[_settingsViewController.view setFrame:childViewFrame];
// Add child views as tab bar items
self.tabBarItems = @[@{@"image" : [NSString stringWithFormat:kKYITabBarItemImageNameFormat, 1],
@"Sales" : _salesViewController} ,
@{@"image" : [NSString stringWithFormat:kKYITabBarItemImageNameFormat, 2],
@"Customers" : _customersViewController}
];
// Add a gesture signal on the first view
UIImage * gestureImage = [UIImage imageNamed:kKYIArcTabGestureHelp];
CGRect gestureImageViewFrame =
(CGRect){{(kKYViewWidth - gestureImage.size.width) / 2.f,
(kKYViewHeight - kKYTabBarHeight - gestureImage.size.height) / 2.f},
gestureImage.size};
UIImageView * gestureImageView = [[UIImageView alloc] initWithFrame:gestureImageViewFrame];
[gestureImageView setImage:gestureImage];
[gestureImageView setUserInteractionEnabled:YES];
[_salesViewController.view addSubview:gestureImageView];
}
demo’s code which does work If I swap it in:
// Override |KYArcTabViewController|'s |-setup|
- (void)setup {
// Set View Frame
self.viewFrame = (CGRect){CGPointZero, {kKYViewWidth, kKYViewHeight}};
// Add child view controllers to each tab
viewControllerOne_ = [[UIViewController alloc] init];
viewControllerTwo_ = [[UIViewController alloc] init];
viewControllerThree_ = [[UIViewController alloc] init];
viewControllerFour_ = [[UIViewController alloc] init];
// Set child views' Frame
CGRect childViewFrame = self.viewFrame;
[viewControllerOne_.view setFrame:childViewFrame];
[viewControllerTwo_.view setFrame:childViewFrame];
[viewControllerThree_.view setFrame:childViewFrame];
[viewControllerFour_.view setFrame:childViewFrame];
// Set child views' background color
[viewControllerOne_.view setBackgroundColor:[UIColor blackColor]];
[viewControllerTwo_.view setBackgroundColor:[UIColor redColor]];
[viewControllerThree_.view setBackgroundColor:[UIColor greenColor]];
[viewControllerFour_.view setBackgroundColor:[UIColor blueColor]];
// Add child views as tab bar items
self.tabBarItems = @[@{@"image" : [NSString stringWithFormat:kKYITabBarItemImageNameFormat, 1],
@"viewController" : viewControllerOne_},
@{@"image" : [NSString stringWithFormat:kKYITabBarItemImageNameFormat, 2],
@"viewController" : viewControllerTwo_},
@{@"image" : [NSString stringWithFormat:kKYITabBarItemImageNameFormat, 3],
@"viewController" : viewControllerThree_},
@{@"image" : [NSString stringWithFormat:kKYITabBarItemImageNameFormat, 4],
@"viewController" : viewControllerFour_}];
// Add a gesture signal on the first view
UIImage * gestureImage = [UIImage imageNamed:kKYIArcTabGestureHelp];
CGRect gestureImageViewFrame =
(CGRect){{(kKYViewWidth - gestureImage.size.width) / 2.f,
(kKYViewHeight - kKYTabBarHeight - gestureImage.size.height) / 2.f},
gestureImage.size};
UIImageView * gestureImageView = [[UIImageView alloc] initWithFrame:gestureImageViewFrame];
[gestureImageView setImage:gestureImage];
[gestureImageView setUserInteractionEnabled:YES];
[viewControllerOne_.view addSubview:gestureImageView];
[gestureImageView release];
}
FYI: few things left out of the demo’s code which is just basic stuff like declaring the properties, init and synthesizing (nothing special though). Also I have tried with and without using the accessors (self. vs _var)
So basically Im wondering why my customer view controllers dont get loaded? Like I said I just get black screens (behind the tab bar).
So the problem was that
Needed the word “viewController” not the name of the view controller. this was a key that the parent class was using to retrieve the views.