IOS Network processing note points

Source: Internet
Author: User

Original link: http://www.jianshu.com/p/a086c33566be

One, AFN use note point 1. Block circular referencing bug resolution

2. Request the manager

  • 1. Request the manager to store the memory

    • Request Manager as a variable, lazy loading, easy to manage all requests, use the Request manager variable to send the request.


2. Note: The controller hangs, we want to stop the request

  • There are two ways to do this, stop the request, and depending on the situation, choose which method.
  • Mode one: After canceling all requests, you can still use the Request Manager manager to send the request again, because the request manager has not yet destroyed in memory
    • Note: The way to use the scene also has: for example, we drag the table drop-down refresh loading the latest data, we should cancel the previous request, and then again request the network to load the latest data, so as to avoid unnecessary bug error.


Mode two: can no longer use the Request Manager manager to send the request, has been hung

3. Multiple reasons for Request failure processing
  • Cause of error: various

    • Domain Name write error
    • Cancel task: [error.code = -999/error.code = nsurlerrorcancelled ( -999_)]
    • Timeout

    • Error logic judgment processing

IOS Network processing note points

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.