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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:10:41+00:00 2026-06-08T09:10:41+00:00

In my iPhone application, I have a button and on the button click I

  • 0

In my iPhone application, I have a button and on the button click I call a web service and getting some links, and after that I need to download the files in those links. On the button click a pop up view will come up and on “OK” click, the button will be replaced with a progress bar and it will show the download progress. And once the download completes, the progress bar will be again replaced by the button. The issue I am having here is, if the internet connection is slow, the UI will blocked and the “Ok” button will be remain in the pressed mode till it completly get the details from the server, only then progress bar will appear. I want to show the progress bar right after the OK button click, it should not lock the UI. I used the following method:

    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 
                                             (unsigned long)NULL), ^(void) {
        [self download];
    });

in this case, the UI didn’t lock, but the progress bar didn’t come. And I used

    [self performSelectorInBackground:@selector(download) withObject:nil];

in this case, UI didn’t block, but it is showing the download button till it gets the details from the server. Only then it is showing the progress bar.

And the code flow for downloading:

- (void)download{
   //Creating a custom progressview
    myprogressView = [[CustomProgressView alloc]initWithFrame:CGRectMake(25, 138, 100, 28)];
    [cell.contentView addSubview:myprogressView];
    [cell bringSubviewToFront:myprogressView];

    //Calling the methods for getting the details from the server

    //after some internal process, start download
    [self.myQueue go];
}

Please share your ideas

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

    Try not to change the UI in any background thread.. All UI related task should be performed on the main thread.. You can call a delegate method to update the UI as soon as data comes in…

    here I can see that you are performing UI related tasks in the background thread… the reason for that is that UIKit is not thread safe… :/

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

Sidebar

Related Questions

I have an iphone application in which in a button click i am showing
I have an iphone application in which in a button click i am showing
I have 4 tabs in my iphone application. When user will click a button
Within my iPhone application I have a common tab bar with three tabs that
I'm developing an iPhone application that have a TabBarController with two tabs. Each tab
HEllo, I have a hybrid iPhone application that has a UITabBarController and 5 Tabs.
I have web application for mobile (developed in .net), I want to use iPhone
I have create an iPhone application. I have a button in a view. In
I've got a sample application on http://github.com/niklassaers/Test-iPhone-TabBar-App that shows my problem: I have a
I have an iphone application containing two views The first view have a button,

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.