1

I am new to the concept of NSURLSession. Now I am working on the sample on NSURLSession. I read so many answers about the difference between them but I didn't understand clearly.Can any one please tell me the difference between them with simple example.

Bhavin Ramani
  • 3,221
  • 5
  • 30
  • 41
anusha hrithi
  • 709
  • 2
  • 9
  • 13

1 Answers1

3

NSURLConnection is a much older API, introduced in OS X 10.2.

NSURLSession was introduced in OS X 10.9, and has a more modern (task- and block-based) API. It is the successor to NSURLConnection, and you should use it in all new projects.

This objc.io post has more information about the two.

jtbandes
  • 115,675
  • 35
  • 233
  • 266