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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:37:11+00:00 2026-06-06T19:37:11+00:00

I’m trying to segue in code. the prepareForSegue function runs and shows correct destination

  • 0

I’m trying to segue in code. the prepareForSegue function runs and shows correct destination view controller, but nothing happens. Any idéas on what I’m missing or what I have misconfigured?

View controller possible path:

A ->B (sgueResultat)
or
A->C (sgueStopSplash)

Code that chooses the segue:

if (proversion)
    [self performSegueWithIdentifier:@"sgueResultat" sender:self];

}
else {
    [self performSegueWithIdentifier:@"sgueStopSplash" sender:self];

}

`

The prepareForSegue that I can confirm is running by NSLog:

- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
 NSLog(@"Source Controller = %@", [segue sourceViewController]);
 NSLog(@"Destination Controller = %@", [segue destinationViewController]);
 NSLog(@"Segue Identifier = %@", [segue identifier]);

Nslog output:

2012-06-26 22:22:26.002 ClosetV2[2333:fb03] Source Controller = <ABStartViewController: 0xeb12270>
2012-06-26 22:22:26.002 ClosetV2[2333:fb03] Destination Controller = <SplashAfterStopViewController: 0x6b2c9e0>
2012-06-26 22:22:26.003 ClosetV2[2333:fb03] Segue Identifier = sgueStopSplash
2012-06-26 22:22:26.003 ClosetV2[2333:fb03] sgueStopSplash

Regards
Andreas

  • 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-06T19:37:12+00:00Added an answer on June 6, 2026 at 7:37 pm

    Make sure your segues are set to “modal” in your storyboard (or custom if you are fancy).

    I remember when I first started using segues when storyboarding came out, I kept trying to use push, which you can only do if you have an embedded UINavigationController. Otherwise, a push segue will simply not function.

    Another thought… where is the code below executing? If an animation is already taking place or if the current view is not already showing on the screen, it will not function properly. For example, if you have this code in your viewDidLoad, it will not work.

    if (proversion)
        [self performSegueWithIdentifier:@"sgueResultat" sender:self];
    
    }
    else {
        [self performSegueWithIdentifier:@"sgueStopSplash" sender:self];
    
    }
    

    Edit: Updated Answer

    Waiting for the [self dismissModalViewController:YES] animation to complete before performing your segue is actually annoying and somewhat messy. I don’t think there is a “proper” way to do it. However, if you put the following method inside the view that has the modal controller and send it a message after using [self dismissModalViewController:YES], you should be in good shape.

    - (void)waitUntilModalControllerIsDismissed
    {
        if(self.modalViewController)
        {
            [self performSelector:@selector(waitUntilModalControllerIsDismissed:)
                       withObject:nil 
                       afterDelay:0.1f];
            return;
        }
        else
        {
            //At this point, the modal animation will be completed and you can perform your segue if you want
        }  
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want to construct a data frame in an Rcpp function, but when I
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.