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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:26:11+00:00 2026-05-12T13:26:11+00:00

Scenario: 1. Show navigation controller based view 2. User select option 3.   Show modal

  • 0

Scenario:
1. Show navigation controller based view
2. User select option
3.   Show modal view A
4. User select another option in modal view A
5.   Hide modal view A
6.   Show modal view B

// This function must show modal view A
This scenario implemented like this:
- (IBAction)showModalViewA:(id)sender {
    ModalViewA *viewA = [[ModalViewA alloc] forParent:self];
    [self presentModalViewController:viewA animated:YES];
    [viewA release];
}

// This function must hide modal view A and show modal view B
- (void)didSelectOptionInViewA {
    ModalViewB *viewB = [[ModalViewB alloc] init];
    viewB.peoplePickerDelegate = self;

    [self dismissModalViewControllerAnimated:NO];            // Problem Is Here
    [self presentModalViewController:viewB animated:YES];
    [viewB release];
}

Please look at line marked as // Problem Is Here
When I set the dismissModalViewControllerAnimated:NO it works fine.
If this parameter is YES then viewB did not appear on the screen.

How to make it works with animation?

  • 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-05-12T13:26:11+00:00Added an answer on May 12, 2026 at 1:26 pm

    The animation will take some time, something like 0.3 seconds. You cannot see when the animation has finished (no delegate methods are being sent) so you can do 2 things:

    1. Present the new modal view controller in a new method and call that method with a delay of 0.3 seconds. This is not an ideal solution because animation times may vary and you can never be sure that the animation has really finished.
    2. Add some kind of a flag instance variable to your main view controller (the one which presents the modal view controller) and set that flag to YES (or do it using bits, then one flag can contain multiple options). Then check in -[UIViewController viewDidAppear:] whether that flag is set and when it is, present the modal view controller.
      1. You can be sure the animation has finished.
      2. Presenting a modal view controller should be done within it’s main view controller

    I really wonder why you would want to do such a thing, because this is really not very Apple-ish. You’d better present the new modal view over the old modal view or you try to find another design pattern which solves the problem properly, which would be even better.

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

Sidebar

Ask A Question

Stats

  • Questions 200k
  • Answers 200k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer See if this helps: http://www.wellho.net/forum/The-MySQL-Relational-Database/My-root-account-is-messed-up-what-can-I-do.html May 12, 2026 at 7:57 pm
  • Editorial Team
    Editorial Team added an answer The GNU libc implementation is threadsafe if libc is configured… May 12, 2026 at 7:57 pm
  • Editorial Team
    Editorial Team added an answer No for VB.NET and VS2008. http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=477562 May 12, 2026 at 7:57 pm

Related Questions

I am creating an application that uses the MS Ribbon Control. The ribbon has
I have the following scenario: 1 List which contains the months of the year:
Consider this scenario, 2 interfaces, 1 generic: public IGenericAdder<T> { T Add(T, T); }
Here's my scenario: <!-- Normal Control --> <div class=required> <label for=address1>Address line 1</label> <input

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.