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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:31:22+00:00 2026-06-05T02:31:22+00:00

I have the following problem: I want that the user make a download when

  • 0

I have the following problem:
I want that the user make a download when pressing a button. During this download, I want to hide the other buttons (which would open the downloaded files, so I want to ensure that no one tries to open files when the update haven’t finished yet).
Is it possible to hide these buttons during this process?

So what I have tried and experienced so far:

  • Changes to the buttons I get always just at the end (when it isn’t necessary anymore, because then the update is done).

I tried the following (Pseudocode):

-(void)updatingprogress
{
    buttona.hidden=TRUE;
}

-(void)updatingfinished
{
    buttona.hidden=FALSE;
}

updateFiles()
{
[self updatingprogress]
... make downloads...
[self updatingfinished]
}

So with logging I see, that I get in my functions at the moment I want, but the changes of the buttons aren’t done during “updatingprogress”. Any Idea how to solve this problem?
Thanks and best regards!

  • 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-05T02:31:24+00:00Added an answer on June 5, 2026 at 2:31 am

    Another possibility is that you’re doing all the work on the main thread, but failing to allow for the fact that, as a rule, UIKit changes don’t take effect until you drop down to the runloop.

    The background logic is that you don’t want partial changes to be visible, so e.g. if you wrote:

    // okay, set to success
    label.textColor = [UIColor greenColor];  // was previously red
    label.text = @"Success";                 // previously said 'Failure'
    

    What you explicitly don’t want is for the word ‘Failure’ to appear in green, then for the word to change to ‘Success’. You want the two changes to occur atomically. Apple achieve this by batching UIKit updates together and effecting them outside of any of your scheduled methods.

    So if you have a function on the main thread that does some UI changes, does some work and then undoes the UI changes, but all without at any point exiting to the runloop, then the changes will never be seen.

    The quickest solution would be:

    - (void)updateFiles
    {
        [self updatingProgress];
        [self performSelector:@selector(doFileUpdate) withObject:nil afterDelay:0.0];
    
        // what does the above achieve? It schedules doFileUpdate on the runloop, to
        // occur as soon as possible, but doesn't branch into it now. So when this
        // method returns UIKit will update your display
    }
    
    - (void)doFileUpdate
    {
        /* heavy lifting here */
        [self updatingFinished];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem that I want to solve in awk. I have
I have the following problem. I want to check that the item clicked on
I have the following code I want to run, but the problem is $this->type
I am using GWT/JAVA for development. I have following problem: I want to remove
I have the following problem: Within a stylesheet document I want to create an
Hi I have the following problem, I want to laod a website with php.
What kind of strategy do I have for the following problem. I want to
I have the following code: The actual problem is the non-quoted code. I want
I have following problem: I have to make a ASP.NET Webapplication with a two-row
I have the following problem/doubt that I hope somebody could help me with. Let's

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.