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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:50:26+00:00 2026-05-27T07:50:26+00:00

Is it possible to add a UIProgressView to a NSURLConnection? Is it as simple

  • 0

Is it possible to add a UIProgressView to a NSURLConnection? Is it as simple as getting the length of the data and then setting it to an int then sending that int to my other class to my UIProgressView?

Can someone show me how to do this? Are there any examples or links that will point me in the right direction?

Thanks!!!

  • 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-27T07:50:27+00:00Added an answer on May 27, 2026 at 7:50 am

    In your didReceiveResponse function you could get the total filesize like so –

    _totalFileSize = response.expectedContentLength;.

    In your didReceiveData function you can then add up to a total bytes received counter –

    _receivedDataBytes += [data length];

    Now in order to set the progressbar to the correct size you can simply do –

    MyProgressBar.progress = _receivedDataBytes / (float)_totalFileSize

    (either in the didReceiveData function or somewhere else in your code)

    Don’t forget to add the variables that hold the number of bytes to your class!

    Here’s how you could implement the delegates in order to update progressview

    -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
        _totalFileSize = response.expectedContentLength;
        responseData = [[NSMutableData alloc] init];
    }
    
    
    -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
       _receivedDataBytes += [data length];
       MyProgressBar.progress = _receivedDataBytes / (float)_totalFileSize;
       [responseData appendData:data];
     }
    

    I hope this helps..

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

Sidebar

Related Questions

It's possible to add some parameters before submit an form? My problem is that
Is it possible to add other else function in my JS like this: ?
Possible Duplicate: add values to enum Why enums in Java cannot inherit from other
is it possible to add a notification to the lockscreen that will not disappear?
Is it possible to add a URL mapping that includes controller/action/id? Example: URL: localhost:8080/myproject/book/scifi/dune
Is it possible to add a namespace to all the partial classes that sqlmetal.exe
Is it possible to add an image overlay to a google map that scales
I'm wondering if it is possible add children asynchronously to stackpanel (or any other
Is it possible to add or remove slides in runtime using FlexSlider ?
Is it possible to add button click event by clicking design of axml? if

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.