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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:13:39+00:00 2026-05-26T09:13:39+00:00

I was looking at the NSURLConnection class which could be used to establish a

  • 0

I was looking at the NSURLConnection class which could be used to establish a sync or async connection to an URL and then retrieve its data… a lot of changes have been made to this class with IOS 5 and I’ve seen they introduced some formal protocols related to authentication or download, but I don’t see, for example, if the connection:didReceiveResponse: message (that was previously sent to the delegate and that it is no more available) is still available in some protocols.. How do you implement an async connection and retrieve, for example, HTTP headers as soon as the Response is received? I’m sure there is a way better than using NSURLConnection along with the connection:didReceiveResponse: message.. methods like stringWithContentsOfURL do always load content synchronously? What do you use to implement async downloads in your apps avoiding deprecated methods and reacting to events such as _http response received_m etc ? Do you launch synchronous downloads in background tasks, if possible?

  • 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-26T09:13:39+00:00Added an answer on May 26, 2026 at 9:13 am

    NSURLConnectionDelegate has become a formal protocol (it was an informal protocol in previous versions). In this protocol, the following (non-deprecated) methods are declared:

    • connection:didFailWithError:
    • connectionShouldUseCredentialStorage:
    • connection:willSendRequestForAuthenticationChallenge:

    Furthermore, there are two subprotocols that conform to NSURLConnectionDelegate:

    NSURLConnectionDataDelegate is used for delegates that load data to memory, and declares the following methods, some of which I’m sure you’ll find familiar:

    • connection:willSendRequest:redirectResponse:
    • connection:didReceiveResponse:
    • connection:didReceiveData:
    • connection:needNewBodyStream:
    • connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:
    • connection:willCacheResponse:
    • connectionDidFinishLoading:

    NSURLConnectionDownloadDelegate is used for delegates that store data directly to a disk file, and declares the following methods:

    • connection:didWriteData:totalBytesWritten:expectedTotalBytes:
    • connectionDidResumeDownloading:totalBytesWritten:expectedTotalBytes:
    • connectionDidFinishDownloading:destinationURL:

    As you can see, you can still use your previous delegates, possibly with some minor modifications.

    For more information, see the iOS 4.3 to iOS 5.0 API Differences document and NSURLConnection.h in your local Xcode installation. When a new SDK version is released, it’s not uncommon for the documentation inside the header files to be more reliable than the documentation available on the developer library. It takes a while for the latter to be up-to-date.

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

Sidebar

Related Questions

I was looking at the NSURLConnection class today, specifically researching method: - (void) connection:
I'm using NSURLConnection to pull data from a webpage. I'm looking to find a
Looking for C# class which wraps calls to do the following: read and write
Looking for a way to get path of file (and then process it in
I was recently looking at an example from apple about NSURLConnection and I tried
Looking for a way to retrieve a file size from a web server using
Looking around at different code bases I see a variety of styles: Class interfaces
Looking for a C++ async HTTP library so I can download some zip files
Looking for an equivalent container class that matches to C#'s Arraylist collections class. Is
Looking for simple php class routing, like this: http://fatfree.sourceforge.net/page/routing-engine Is there a ready-made solutions?

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.