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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:52:39+00:00 2026-06-10T09:52:39+00:00

After selecting an option from a popover controller, the delegate is informed that a

  • 0

After selecting an option from a popover controller, the delegate is informed that a selection has been made.

I want to dismiss the popover, have it removed from the screen, and display an activity indicator to the user.

Unfortunately, the code below the dismissPopover runs before the popover actually disappears, resulting in a long wait without anything appearing to be happening.

- (void)itemSelected:(int)option {

    [popController dismissPopoverAnimated:YES];

    activityIndicator.hidden = NO;
    [activityIndicator startAnimating];

    switch (option) {
        case 0:
            // Do something that takes some time
            break;

        case 1:
            // Do something that takes even longer
            break;
    }

}

What’s the best way to return control back to the calling ViewController after dismissing the popover?

  • 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-10T09:52:41+00:00Added an answer on June 10, 2026 at 9:52 am

    The problem is that when you change the UI, it doesn’t happen instantly. The changes are actually queued up to occur next time the main event loop finishes. Since that usually happens right away, we usually don’t have to worry about the difference. All UI updates happen on the main thread, and since your long operations are also on the main thread, the app never gets around to updating the UI until the long operations are done.

    One solution would be to use Grand Central Dispatch to offload those operations to another thread, which will allow the main thread to continue executing (and the UI to continue updating) until the operation is done.

    dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
    
    dispatch_async(queue, ^{
        [self performReallyLongOperation];
    });
    
    dispatch_release(queue);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do you enable or disable a select tag after selecting an option from
I have a list in a select. After selecting an option i do a
My dropDownList dropDown displayObject is stays visible after I am selecting an option. This
I'm trying to present a modal view controller after selecting a contact and it
Basically I want to alter the boolean value selecting from the table: e.g.: SELECT
I can't read dates from ajax calendar control after date selection http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/Calendar/Calendar.aspx I don't
From the JSP page, I need to browse excel file and after selecting file
I have DropDownList, which has some options to choose from. Now after when user
I am selecting time slot on dragging on Exam time cell. After selecting time
I have following requirement in my application. A tableView with games title After selecting

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.