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 7776011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:46:08+00:00 2026-06-01T17:46:08+00:00

I had a tabBarApplication that I have as a template which has a UINavigation

  • 0

I had a tabBarApplication that I have as a template which has a UINavigation template on each tab.

I want to use that sample (sort of) and convert it into a single UIViewController in a nother application. I have presented 2 pieces of code, the first one is my template and the latter is what I am trying to make. Could anyone please give me some hints or help with how to that right? I keep getting errors, but they do not make sense to me as the tabBarApp does not need it a viewController declared.

First Code (the example):

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self setupFetchedResultsController];

if (![[self.fetchedResultsController fetchedObjects] count] > 0 ) {
    NSLog(@"!!!!! ~~> There's nothing in the database so defaults will be inserted");
    [self importCoreDataDefaultRoles];
}
else {
    NSLog(@"There's stuff in the database so skipping the import of default data");
}

// The Tab Bar
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;

// The Two Navigation Controllers attached to the Tab Bar (At Tab Bar Indexes 0 and 1)
UINavigationController *personsTVCnav = [[tabBarController viewControllers] objectAtIndex:0];
UINavigationController *rolesTVCnav = [[tabBarController viewControllers] objectAtIndex:1];
return YES;
}

Second Code (what I am trying to make):

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self setupFetchedResultsController];

if (![[self.fetchedResultsController fetchedObjects] count] > 0 ) {
    NSLog(@"!!!!! ~~> There's nothing in the database so defaults will be inserted");
    [self importCoreDataDefaultRoles];
}
else {

UIViewController *mainViewController = (UIViewController *)self.window.rootViewController;

UINavigationController *readingsTVCnav = [[mainViewController viewController] objectAtIndex:0];

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

The fetching parts of the code are related to Core Data which already set up and working.
The reason for this change is that I want to have a plain view controller set up as the initial screen rather than the tabBarConfiguration.

Cheers Jeff

EDIT: I have added an image for clarity

enter image description here

  • 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-01T17:46:09+00:00Added an answer on June 1, 2026 at 5:46 pm

    From what you describe and depict in your image, you have the navigation controller set up as your app’s root view controller. So you can access it (if you need to) in your app delegate’s didFinishLaunchingWithOptions: method as follows:

    UINavigationController *navController = (UINavigationController *)self.window.rootViewController;
    

    Although for your app I don’t think there’s any reason you need to reference the nav controller from your app delegate. All the setup you need (with the exception of your code data code, which you say is already working) can be handled through the storyboard.

    In your nagivationController’s root viewController (the one with all the buttons) you should set up a segue from each button to the approperiate viewController in your storyboard. Bure sure to set then up as “push” segues so that it will push the view controller onto your navigationController’s navigation stack. If there is any particular setup you need to do for the child view controller when the segue happens, you can implement the prepareForSegue: method like this:

    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
        if ([segue.identifier isEqualToString:@"ShowMyViewController"]) {
    
            MyViewController *vc = (MyViewController*)segue.destinationViewController;       
            vc.title = @"My Title";
            vc.someProperty = @"Some Value";
        }
    }
    

    You can (and should) identify each of your segues in the storyboard with a unique identifier so that you can identify them when this method is called.

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

Sidebar

Related Questions

Had a problem with the recursive conflictCheck() method. That seems fine now. I have
I had a Navigation Controller based application and decided to use tab bars. And
Had to change this up. I have two arrays and I want to essentially
Had a question that I've often wondered about. Is it better to have multiple
I have a tabbar application. Second tab had a drill down table list with
Had a page that was working fine. Only change I made was to add
Had a good search here but can't see anything that gets my mind in
I had created one HTML page for my experiance. In this i had use
Had something weird start happening to me today. I have an asp.net mvc app
Had a question and if anyone has found similar issues. It seems my file

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.