Basic use of network programming--1 and nsurlsession for iOS development

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.