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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:14:41+00:00 2026-05-19T01:14:41+00:00

Hey! I need to know how I can have my iOS Application start a

  • 0

Hey! I need to know how I can have my iOS Application start a download in the background of the application (like, have the download run in the AppDelegate file) so changing ViewControllers will not interrupt or cancel the download. I also need to be able to get the progress of the download (0.00000 - 1.00000), to set a UIProgressView object to, which also means I need a - (void)progressDidChangeTo:(int)progress function.

  • 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-19T01:14:41+00:00Added an answer on May 19, 2026 at 1:14 am

    Just use ASIHTTPRequest it is way easier than NSURLRequest and does exactly what you need.
    It examples that shows how to download in background and how to report progress.

    I wouldn’t download anything in the AppDelegate directly. Instead I would create a separated class just for that purpose. Let’s call it MyService I would then initialize that class in my app delegate.

    The class can work as a singleton or can be passed to each view controller that requires it.

    In MyService class I would add the ASINetworkQueue and few methods to handle the requests when they are ready. Here is the code from ASI examples that you can use:

    - (IBAction)startBackgroundDownloading:(id)sender
    {
       if (!self.queue) {
          self.queue = [[[ASINetworkQueue alloc] init] autorelease];
       }
    
       NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"];
       ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
       [request setDelegate:self];
       [request setDidFinishSelector:@selector(requestDone:)];
       [request setDidFailSelector:@selector(requestWentWrong:)];
       [self.queue addOperation:request]; //queue is an NSOperationQueue
       [self.queue go];
    }
    
    - (void)requestDone:(ASIHTTPRequest *)request
    {
       NSString *response = [request responseString];
       //Do something useful with the content of that request.
    }
    
    - (void)requestWentWrong:(ASIHTTPRequest *)request
    {
       NSError *error = [request error];
    }
    

    If you need to set the progress bar. I would just expose the setDownloadProgressDelegate of ASINetworkQueue in my MyService class and set it in my ViewControllers like that:

    [[MyService service] setDownloadProgressDelegate: self.myUIProgressView];
    

    BTW. If you need to continue downloading even when your app exits you can set ShouldContinueWhenAppEntersBackground property of your request to YES.

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

Sidebar

Related Questions

Hey, making a media player and need to know something. I have a menu
Hey gang, I need to know if i need to restart my computer to
Hey all, I have something of an interesting requirement for my project. I need
Hey folks, every once in a while I have the need to automate data
Hey, i'm extending some WPF controls, and need to implement some custom events. I've
Hey, I've been developing an application in the windows console with Java, and want
Hey peoples, I've been studying Java for a couple of weeks, and have decided
hey guys, i wonder how difficult it is (and what programming languages i need)
Hey, Iam new to objective c and really dont know much about it. I
OK, so I have these background <div> s which pan left and right using

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.