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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:17:37+00:00 2026-06-01T21:17:37+00:00

I have found the oddest behavior with my iOS app. I have this code:

  • 0

I have found the oddest behavior with my iOS app. I have this code:

         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
             CMLog(@"Start Save RoundQuestions Asynchronously");
             [round saveRoundQuestions:target selector:selector];
         });

That function finishes it’s work and calls this:

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
        [target performSelector:selector];
#pragma clang diagnostic pop

The logs show everything running properly, however the target calls a pushViewController on a navigationController, and it takes forever to do the actual push. I can force it to go on by clicking the home button. I’ve read that I’m probably violating thread safety and the run loop may need to be awakened.

Is it wrong to call a selector from a dispatch_async? Or do I need to perform the selector on the main thread where the UI is?

EDIT: I actually figured out the problem. It turns out that I was calling a function that was blocking the UI inside of the saveRoundQuestions which I believe was forcing the push animations to the back of the line, so to speak. I put this function in the background and the push animation now happens immediately. But I’m still curious as to why?

  • 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-01T21:17:39+00:00Added an answer on June 1, 2026 at 9:17 pm

    You can successfully update UI using dispatch_async. Just instead of using dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0) use dispatch get_main_queue()

    edit:
    According to your update. If you are doing some expensive job inside saveRoundQuestions, and then updateUI, you should use:

     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
             CMLog(@"Start Save RoundQuestions Asynchronously");
             [round saveRoundQuestions:target selector:selector];
         });
    

    And then inside of saveRoundQuestions put another block in dispatch_get_main_queue() to update UI.

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

Sidebar

Related Questions

I have found this project on Codeplex. http://www.codeplex.com/ProjNET I need to integrate this code
Have found a function address in a DLL. Have no source code for this
I have found that writing PHP code within classes can become rather long: $this->parser->parse_syntax($this->get_language_path($this->language),
I have found this Regex extractor code in C#. Can someone tell me how
I have found this code for a custom UITableViewCell : UITableViewCell *cell = [tableView
I have seen the oddest behavior from JavaScript and would love some insight into
I have asked the same question before and I found this solution : if
I have found what I think is peculiar behavior in Android 3.x (Gingerbread) for
I have found this question but it was written in 2009, presumably since then
I have found weird behavior of CUDA. After I got segfault in my kernel,

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.