Original link: http://www.jianshu.com/p/a086c33566be
One, AFN use note point 1. Block circular referencing bug resolution
2. Request the manager
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