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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:00:35+00:00 2026-06-14T05:00:35+00:00

ive got a navigation controller with a simple view as its rootsview. it has

  • 0

ive got a navigation controller with a simple view as its rootsview. it has a button connected via a seque to a second view controller. The seque cause the second view controller to show up modal. If a condition isnt true i directly want to show up this second view controller after application launched.
I tried out a lot of code but it just wont work. Here is a screenshot of my scene :My Scene

Any Ideas how to do this?


I tried the following :

UIStoryboard *storybord = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; 
UINavigationController *vc = [storybord instantiateInitialViewController]; 
[[vc.viewControllers objectAtIndex:0] performSegueWithIdentifier:@"simple" sender:self];

but i got the following error message :

Attempt to present <UINavigationController: 0x71b2ab0> on <UINavigationController: 0x71b12c0> whose view is not in the window hierarchy!

  • 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-14T05:00:36+00:00Added an answer on June 14, 2026 at 5:00 am

    I assume you’re trying that sample code from app delegate? You need to make sure you don’t try to perform the segue until after the first view is loaded. Coincidentally, if you wait until then, its much easier as all you need to do the performSegueWithIdentifier. Thus, in the viewDidLoad of the first view controller, e.g.:

    if (bShouldAutomaticallyPerformSegueToSecondVC)
        [self performSegueWithIdentifier:@"simple" sender:self];
    

    Obviously, replace bShouldAutomaticallyPerformSegueToSecondVC with whatever logic is appropriate to determine when you automatically want to go to the second view controller.

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

Sidebar

Related Questions

I've got a parentViewController with a navigation controller. I push a view on the
ive got a view based application containg a button clicking the button takes you
I've got a Navigation iPhone app and it's second level controller is currently a
I've got a navigation controller with a view and a navigation bar. I want
I've got a navigation controller based app that downloads an RSS feed and lays
I've got an app that initially loads in one view controller for a period
When I add a Navigation bar with Interface Builder to a Table View Controller
i have got two view. First: FirstViewController Second: SecondViewController FirstViewController is my UINavigationController 's
I've got one view controller that I want to have a top bar, and
I've got an app where I am pushing a modal view controller. It is

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.