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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:07:46+00:00 2026-06-03T05:07:46+00:00

I am facing a crash on following statement in IOS 5. This seems to

  • 0

I am facing a crash on following statement in IOS 5. This seems to work in other IOS versions. The scenario is that I am presenting a view as a modal from a viewController and then on tap on cancel button I call the below code to dismiss the self as modal view. This work fine till here.

But after 30 seconds I redraw my view by calling the server to get latest data and after view is drawn again when I tap on “Cancel” button I get a crash — Only on IOS 5.0. Any clue for this?

[self dismissModalViewControllerAnimated:YES];

Error:

Single stepping until exit from function -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:]

This is the screenshot of error in the thread trace:

enter image description here

  • 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-03T05:07:48+00:00Added an answer on June 3, 2026 at 5:07 am

    If the administrator allows me to add a new comment (my last one was removed) I could explain what was happening in my case.

    There is something in this link that I recognise I was doing wrong.

    The problem comes when presenting the view, however the application crashes when dismissing it. Now, what is the problem? In my code I was presenting the view immediately next to a popToRootViewControllerAnimated: call. As you can see in link I have just pasted, iOS5 seems to have some restriction when presenting modal views. As a summary of the link, you cannot make presentModalViewController:animated: before viewDidLoad and viewWillAppear: are finished:

    It turns out that iOS guidelines don’t want model view controllers to be presented in viewDidLoad or in viewWillAppear

    That was exactly my fault. What can you do if this is happening to you? You can present the modal view after a delay. So, instead of using this:

    [[self navigationController] popToRootViewControllerAnimated:NO];
    [self presentModalViewController:loginNavController animated:YES];
    

    you should use this:

    [[self navigationController] popToRootViewControllerAnimated:NO];
    double delayInSeconds = 0.5;
    dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
    dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
        [self presentModalViewController:loginNavController animated:YES];;
    });
    

    (I suppose a performSelector:afterDelay: also works)…

    and make sure delayInSeconds is big enough to let viewDidLoad and viewWillAppear finish. Sorry if this not very accurate and elegant, but at least it works.

    Regards.

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

Sidebar

Related Questions

iam facing problem in passing array to view. this is my controller code.. function
I'm facing that crash while keyboard is shown. As suggested in Apple docs I'm
I´m facing this problem: I have a Button that works like a WrapPanel using
I'm facing a strange crash of my app that occurs only with iOS5. The
Facing some issue in Talend Admin Console, the jobs that are running from IDE
Facing a problem, it seems my data stored in SQL Server does not stored
Im facing the following problem: I want to integrate the mercurial hash into my
Facing problem for generating SQL Server Query In the Following query dynamic conditions are
Am facing few issues with multi step transction in hibernate. This is what I
Facing this error during the connection of Twitter in Wordpress login Catchable fatal error:

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.