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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:03:46+00:00 2026-06-17T07:03:46+00:00

I am trying to perform a downloading in a background thread.For this, I have

  • 0

I am trying to perform a downloading in a background thread.For this, I have created an instance of NSOperationQueue and add an instance of NSInvocationOperation to it.

        operationQueue = [NSOperationQueue new];
        // set maximum operations possible
        [operationQueue setMaxConcurrentOperationCount:1];

        NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self
                                                                                selector:@selector(startBackgroundThread:)
                                                                                  object:data];

        [operationQueue addOperation:operation];
        [operation release];

Now in startBackgroundThread,I have created a new NSURLConnection and dispatching the operationQueue to it.

    currentConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:NO];
    if (self.operationQueue) {
        [currentConnection setDelegateQueue:self.operationQueue];
    }        
    [currentConnection start];

Behavior in iOS6

Working exactly fine on iOS6.
A thread gets created and NSURLConnection callbacks it delegates on the same background thread.

Behavior in iOS5 and iOS5.1

A thread gets created but NSURLConnection delegates didn’t get called.

Am i missing something that need to be taken in account in iOS5?
I have read the documention provided by Apple but nothing is mentioned there related to that.

  • 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-17T07:03:46+00:00Added an answer on June 17, 2026 at 7:03 am

    If you are trying to perform a background web request then use the following convenience method.

    [NSURLConnection sendAsynchronousRequest: queue: completionHandler:];
    

    Block apis give better performance and recommended by apple.

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

Sidebar

Related Questions

I am trying to perform a method in a background thread using a NSOperationQueue
I'm trying to perform a complex issue, I have a query structured like this:
I am trying to perform a JNDI-lookup from within the GWT devmode. I have
I'm trying to perform a DISTINCT clause on a query like this SELECT DISTINCT
I'm trying to perform a bulk insert a set of rules into a table
I'm trying to perform a deep copy of an object in which the new
I'm trying to perform an SQL injection on a dummy website created on my
Trying to perform a very simple task here. I have an <ol> that contains
I have been trying to perform some OpenGL ES performance optimizations in an attempt
I'm trying to perform a string split on a set of somewhat irregular data

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.