Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9154537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:26:36+00:00 2026-06-17T12:26:36+00:00

Im trying to use this tab bar view controller but am having difficulties getting

  • 0

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:
enter image description here

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).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:26:37+00:00Added an answer on June 17, 2026 at 12:26 pm

    So the problem was that

    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_}];
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following view controllers hierarchy: View Controller VC1 Tab Bar Controller TBC1 -
I am trying to do an App with tab bar controller, one of this
I'm trying to use this to create a splash screen, but I only get
I'm actualilly trying tu use this nice widget : http://quasipartikel.at/multiselect_next/ I have two of
I trying to use AndroidAnnotaions, but getting ClassNotFoundException error in my project. For testing
I am trying to use this code: ((AppDelegate)UIApplication.SharedApplication.Delegate).MainTabBarController.Reset(); but I want to know if
Trying to use this method (gist of which is use self.method_name in the FunnyHelper
Trying to use this code to connect the AD PrincipalContext context = new PrincipalContext(ContextType.Domain,
trying to use this route: from(activemq:profiles).aggregate(header(cheese)).batchSize(30).bean(ProfilesQueueService, saveContacts) Fails with: No signature of method: org.apache.camel.model.RouteType.aggregate()
Im trying to use this page slider jquery plugin, you can see the demo

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.