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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:35:55+00:00 2026-06-12T04:35:55+00:00

I am new to objective C so please forgive me if this is a

  • 0

I am new to objective C so please forgive me if this is a stupid question (and I have searched!)

I am using storyboards in xcode (4.4.1) and I have 2 UIViewControllers
I am trying to programmatically switch between them (not sure if that’s the right terminology?)

    UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
    UIViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier:@"BookingView"];
    [self presentModalViewController:vc animated:YES];

The above code works perfectly later on in my project, but I when i try call if in an if() in my viewdidload method in the first UIViewController it doesn’t work. Help please!

  • 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-12T04:35:56+00:00Added an answer on June 12, 2026 at 4:35 am

    You shouldn’t perform such task in the viewDidLoad: method.
    You’re trying to present a view controller modally on top of another that’s only been allocated in memory and loaded, but it’s not visible yet. That means your presentation won’t work. You should move your code to viewDidAppear:

    I recommend you to read this guide to learn the basics about view controller delegation: http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html%23//apple_ref/doc/uid/TP40007457

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

Sidebar

Related Questions

I'm quite new in Objective-c leaning so if my question is too stupid, please
I am new to objective-c, xcode and app dev so please bear this in
Fairly new to Objective C and trying to work within Storyboards given it's the
Please forgive me if this is an obvious question or if there are any
OK, I am quite new to this Objective-C and JSON thing, so please bare
First, I am super-new to Objective-C/iOS development and, in fact, this question is for
i am new to Obejctive C, so please forgive me if this is a
Please let me preface this question with an apology. I am very new to
I'm new to objective-c so please excuse my lack of knowledge. I have a
I am new with xCode and objective C. I am using NSXMLParser to parse

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.