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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:13:01+00:00 2026-06-17T21:13:01+00:00

Using storyboards, MainMenuViewController presents Number1ViewController modally with this: -(void) goToNumbers { [self performSegueWithIdentifier: @seguetonumbers

  • 0

Using storyboards, MainMenuViewController presents Number1ViewController modally with this:

-(void) goToNumbers {

    [self performSegueWithIdentifier: @"seguetonumbers" sender: self];

}

Then Number1ViewController presents Number2ViewController like this:

-(void)nextLevel {

     [self performSegueWithIdentifier: @"segueToLevel2" sender: self];
}

xCode then produces this warning:

2013-01-23 12:09:49.873 ToddlerTeacherMini[7574:907] Warning: Attempt to present <Number2ViewController: 0x1fddc720> on <Number1ViewController: 0x1fdc7380> whose view is not in the window hierarchy!

Evertything I see online about this warning says that you cannot present a VC in another VC’s viewDidLoad method and moving your code to the viewWillAppear method will fix this. Im not calling this segue from viewDidLoad but rather im calling it way later so Im not sure why this is happening.

I present VC’s similarly elsewhere in my app without issue and cant figure out what is different here, any help?

To be clear everything appears to work as expected in my app I just dont want to ignore this message and have it come back and bite me later.


Per Todd Kerpelman’s suggestion I looked into where my nextLevel method was getting called. Breakpoint didnt tell me much but digging a little further with NSLog I came up with this:

-(void)nextLevel {


    if (nextLevelHasNotBeenCalled == 0){

       [self performSegueWithIdentifier: @"segueToLevel2" sender: self];
        NSLog(@"Segue was called here.");

    }

    nextLevelHasNotBeenCalled ++;
    NSLog(@"Next level has been called %i times!", nextLevelHasNotBeenCalled);


}

Log:

2013-01-26 02:04:12.579 ToddlerTeacherMini[9203:907] Segue was called here.
2013-01-26 02:04:12.593 ToddlerTeacherMini[9203:907] Next level has been called 1 times!
2013-01-26 02:04:14.789 ToddlerTeacherMini[9203:907] Next level has been called 2 times!

Pretty clear now that nextLevel is getting called twice and is what is causing my problem.

  • 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-17T21:13:02+00:00Added an answer on June 17, 2026 at 9:13 pm

    This sounds like a case of your code accidentally calling nextLevel when you’re not expecting it to. (Probably as a side effect of some unrelated method being called in your Number1ViewController’s viewDidLoad method.)

    Did you try adding a breakpoint to your nextLevel method and seeing how/where it’s getting called? That’s probably the best way to at least confirm (or eliminate) this possibility.

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

Sidebar

Related Questions

I'm using Storyboards and I basically have this: It's a mapView that presents modally
MainMenuViewController presents BonusViewController modally. I want to Dismiss BonusViewController then display a new BonusViewController,
This is my first app using storyboards/segues, and I'm pretty sure the answer to
In my application I am using storyboards, this is how it's set up: UIViewController
This is a general iOS 5+/4 question: If I make my app using storyboards,
I have a Table View Controller which I have designed using storyboards. This has
I am using Storyboards for a fairly simple MasterDetail app. The Master shows a
I created an app for iPad (not using StoryBoards), with a UITabBarController. I added
I've set up a really simple project using storyboards including two views as shown
I have an iOS 5 Tabbed Application, using Storyboards. My Tabbar Controller points 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.