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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:22:37+00:00 2026-06-07T03:22:37+00:00

I have been working with a few applications that deal with NSURLConnections. While researching

  • 0

I have been working with a few applications that deal with NSURLConnections. While researching best practices I have noticed a lot of examples online showing how to use NSOperation and NSOperationQueue to deal with this.

I have also noticed on stackoverflow a few examples that show initializing the connection as synchronous and asynchronous using the class methods of NSURLConnection: sendAsynchronousRequest and sendSynchronousRequest.

Currently I am doing my initialization as follows:

[[NSURLConnection alloc] initWithRequest:request delegate:self];

While doing this I have monitored the main thread and the calls to the delegate methods:

connectionDidFinishLoading, connectionDidReceiveResponse, connectionDidReceiveData and connectionDidFailWithError

Everything I have read in Apples documentation and my tests prove to me that this is asynchronous by default behavior.

I would like to know from more experienced Objective C programmers when the other options would be used for either a best practice, or just be more correct than what I see as the most simplistic way to get async behavior?

This is my first question I have posted on here, if more information is needed please ask.

  • 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-07T03:22:38+00:00Added an answer on June 7, 2026 at 3:22 am

    The method you list are the traditional means of asynchronous transfer and an app that uses them will be efficient in processor (and hence power) use.

    The sendAsynchronousRequest method is a relatively new addition, arriving in iOS 5. In terms of best practice there’s little other than style to differentiate between it and the data delegate methods other than that a request created with the latter can be cancelled and a request created with the former can’t. However the tidiness and hence the readability and greater improbability of bugs of the block-based sendAsynchronousRequest arguably give it an edge if you know you’re not going to want to cancel your connections.

    As a matter of best practice, sendSynchronousRequest should always be avoided. If you use it on the main thread then you’ll block the user interface. If you use it on any other thread or queue that you’ve created for a more general purpose then you’ll block that. If you create a special queue or thread for it, or post it to an NSOperationQueue then you’ll get no real advantages over a normal asynchronous post and your app will be less power efficient per Apple’s standard WWDC comments.

    References to sendSynchronousRequest are probably remnants of pre-iOS 5 patterns. Anywhere you see a sendSynchronousRequest, a sendAsynchronousRequest could be implemented just as easily and so as to perform more efficiently. I’d guess it was included originally because sometimes you’re adapting code that needs to flow in a straight line and because there were no blocks and hence no ‘essentially a straight line’ way to implement an asynchronous call. I really can’t think of any good reason to use it now.

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

Sidebar

Related Questions

I have developed a WCF service that has been working fine for a few
So I have been working on this for a few days now, and I
I've been working on this problem for a few hours and have used many
I have been working on a Windows Mobile app for a little while now
I have been working on this issue for a few days now and can't
I have been working on creating an application that sends a string from an
I have been working with eclipse and android for a few months now and
I have only been working with C# for a few weeks and I have
I am a university student. I have been working a lot with Android lately
I have been working on this for a few days and this is doing

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.