Preface: Before learning the use of nsurlsession, learn a good article about Nsurlsession "from nsurlconnection to Nsurlsession" or a domestic translation "from the Nsurlconnection to Nsurlsession ", or do not have to learn my blog Park notes directly to learn from the nsurlconnection to Nsurlsession" is also possible, this article on the use of nsurlsession has a very detailed discussion. But first of all, this paper briefly introduces the basic of Nsurlsession and base network request use, in case I forget to review the use of????。
Learn Nsurlsessiontask:
With nsurlsession you need to use Nsurlsessiontask, so the relationship between the class of the task and its subclasses is still to be understood:
English blind?? : Session Task Tasks
The main new code knowledge:
Nsurlsession:
-(nsurlsessiondatatask*) datataskwithrequest Create a task based on the request object
-(nsurlsessiondatatask*) Datataskwithurl Create a task based on the requested URL
Nsurlsessiondatatask:
-(void) resume to perform the task
Basic use of code presentation (using Nsurlsessiondatatask):
Code presentation using the Proxy method:
Basic use of network programming--1 and nsurlsession for iOS development