Need to have your class to conform to the NSURLConnectionDelegate protocol and declare a var to store the response data
Implement the NSURLConnectionDelegate protocol methods
Create an instance of NSURLRequest and NSURLConnection to kick off the request
In Step#1, when you class conforms to the NSURLConnectionDelegate protocol, it means that your class will need to implement all the required methods, which takes you to Step#2.
The idea is that when you kick off the request in Step #3, you want to be notified of events that will happen such as when the response comes back, and need to handle them appropriately.
Within the class that you will be using NSURLConnection, specify in the header file that it conforms to the NSURLConnectonDelegate protocol. Also, declare an instance variable for holding the response data.
Next, implement the NSURLConnection protocol methods
Now, we are finally ready to perform the asynchronous request.
Let's start by creating an instance of NSURLRequest, and assign it to the URL. Next, create an instance of a NSURLConnection and call the initWithRequest method, passing it your NSURLRequest.
After the NSURLRequest is dispatched and the request is handled, the callback handler, didReceiveResponse will be invoked to indicate that the server has responded. Then, the callback handler, connection:didReceiveData will be invoked. This is where you will append the new data to the instance variable you declared. In connectionDidFinishLoading callback is invoked when the request is complete and the data has been received, so you can parse the response data and do whatever you want to do with the data. That's all there's to it!
In the next blog post, I will cover how to send an asynchronous request using NSURLSession and Blocks!