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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:39:38+00:00 2026-06-18T11:39:38+00:00

I have a Tab Bar application that shows several tabs. I case of notification

  • 0

I have a Tab Bar application that shows several tabs. I case of notification I want user to be directed to a view controller with the ability to push “Back”.
When my app was only Navigation controller app, I used this code in my AppDelegate:

UIStoryboard *mainStoryboard = self.window.rootViewController.storyboard;
DetailViewController *detailViewController = (DetailViewController*)[mainStoryboard instantiateViewControllerWithIdentifier: @"detailViewController"];
[(UINavigationController*)self.window.rootViewController pushViewController:detailViewController animated:NO];

This code used to work fine until I converted my app to be Tab Bar. Seems like the “self.window.rootViewController” is not longer of type “UINavigationController” and therefore calling “pushViewController” generates an exception saying method doesn’t exist.
Any way to make this work on a Tab Bar application?

Thanks

  • 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-18T11:39:40+00:00Added an answer on June 18, 2026 at 11:39 am

    You should present your notification controller as modal (presentViewController:animated:completion:), and inside that controller you provide a way to close it, probably a button on top bar.

    EDIT:
    Thanks for Dimitry’s answer I was able to go on the right track. I just had to make a small trick in order to preserve the top navigation bar and the bottom tool bar. I did it by using a “UINavigationController” instance. Here is the code:

    UIStoryboard *mainStoryboard = self.window.rootViewController.storyboard;
    DetailViewController *detailViewController = (DetailViewController*)[mainStoryboard instantiateViewControllerWithIdentifier: @"detailViewController"];
    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:detailViewController];
    navigationController.navigationBar.tintColor = [UIColor blackColor];
    navigationController.toolbar.tintColor = [UIColor blackColor];
    [self.window.rootViewController presentViewController:navigationController animated:YES completion:NULL];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table view in an iPhone xcode tab bar application that shows
I have an application with several view controllers controlled from a tab bar controller.
Within my iPhone application I have a common tab bar with three tabs that
I have a tab bar application and when I display a modal view controller,
So I have an application that embeds a Navigation Controller inside a Tab Bar
I have a tab bar application with three tabs. In my second tab view
I have a tab bar application and I want to display those views that
I have a tab bar application. Each tab contains navigation controller allowing the user
In my application i have Tab bar Controller. I want to change default color
i have a tab bar application, now what i want to do is to

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.