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

  • SEARCH
  • Home
  • 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 6924889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:43:11+00:00 2026-05-27T10:43:11+00:00

I have been following this tutorial to set up a tableview with storyboarding. It’s

  • 0

I have been following this tutorial to set up a tableview with storyboarding.

It’s all working, except in the beginning of the tutorial he starts with a tabBarView template and he embeds a UINavigationControl in that.

So this is the code that he comes up with – which works:

    UITabBarController *tabBarController = 
(UITabBarController *)self.window.rootViewController;

UINavigationController *navigationController = 
[[tabBarController viewControllers] objectAtIndex:0];

AlbumViewController *albumsViewController = 
[[navigationController viewControllers] objectAtIndex:0];
albumsViewController.albums = albums;

Which is part of:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:      (NSDictionary *)launchOptions
{
albums = [NSMutableArray arrayWithCapacity:5];
Album *album1 = [[Album alloc] init];
Album *album2 = [[Album alloc] init];
Album *album3 = [[Album alloc] init];
Album *album4 = [[Album alloc] init];
Album *album5 = [[Album alloc] init];

album1.albumName = @"Graduation";
album2.albumName = @"Dark and Twisted Fantasy";
album3.albumName = @"Torches";
album4.albumName = @"Nothing But The Beat";
album5.albumName = @"Angles";

album1.artist = @"Kanye West";
album2.artist = @"Kanye West";
album3.artist = @"Foster The People";
album4.artist = @"David Guetta";
album5.artist = @"The Strokes";

album1.rating = 5;
album2.rating = 5;
album3.rating = 5;
album4.rating = 5;
album5.rating = 5;

[albums addObject:album1];
[albums addObject:album2];
[albums addObject:album3];
[albums addObject:album4];
[albums addObject:album5];

UITabBarController *tabBarController = 
(UITabBarController *)self.window.rootViewController;

UINavigationController *navigationController = 
[[tabBarController viewControllers] objectAtIndex:0];

AlbumViewController *albumsViewController = 
[[navigationController viewControllers] objectAtIndex:0];
albumsViewController.albums = albums;

// Override point for customization after application launch.
return YES;
}

This part is posted in the AppDelegate.m
I am really trying everything, but nothing works.

Any Help would be great:-)

PS If I take out the tabView or comment out the first bit of code, the TableView shows, but there is no data in it.

Cheers Jeff

  • 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-05-27T10:43:12+00:00Added an answer on May 27, 2026 at 10:43 am
    UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;  
    

    Here, the code is getting the root view controller of the window, which from the original project was a tab bar controller. You have removed this, so this will be returning a navigation controller.

    You’ve removed a level of containment from the view controller hierarchy. Your root view controller is now a navigation controller. So, I think the code you need is:

    UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController;
    AlbumViewController *albumsViewController = [[navigationController viewControllers] objectAtIndex:0];        
    albumsViewController.albums = albums;   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to NHibernate... I have been following this NHibernate Tutorial from Gabriel Schenker
I've been following along with this excellent asio tutorial , but have got confused
I have been following this tutorial series for OpenGL : GLUT : http://www.lighthouse3d.com/opengl/glut/ I
i have been following this tutorial for the pagerAdapter. http://mobile.tutsplus.com/tutorials/android/android-user-interface-design-horizontal-view-paging/ My problem is that
I am new to WP7 programming and I have been following this tutorial http://weblogs.asp.net/scottgu/archive/2010/03/18/building-a-windows-phone-7-twitter-application-using-silverlight.aspx
I have been following this tutorial, http://ruby.railstutorial.org/chapters/modeling-users?version=3.2#top , which I find great, but it
I have been following this tutorial , and at step 5, I am getting
I have been following this tutorial for setting up tabs in your application. http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
I've been battling to get this right...basically I have the following HTML setup: <div
I'm a newcomer to Rails, and have been following the tutorial on the rails

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.