IOS afnetworking setting Time-out

Source: Internet
Author: User

(Summary of original experience)

1. The assertion of AF timeout

The system default timeinterval is 60s ASI default is 10s

But there's a saying that AF "AFN can work with nsurlrequest set under get conditions, but not enabled under post conditions (due to Apple internal mechanism, fixed to 240s)"

This is old, and the latest is nothing to correct the story.

After testing the IOS5 is 240s saying that IOS8 is not entirely custom based on the meaning of stack flow that the dividing line is in IOS6

Conclusion: ios>=ios6.0? Custom: 240s

2. Here are two ways to set the time

nsurlrequest*request =[nsurlrequest requestwithurl: [Nsurl urlwithstring:[baseurl Stringbyaddingpercentescap Esusingencoding:nsutf8stringencoding]] Cachepolicy:nsurlrequestuseprotocolcachepo Licy timeoutinterval:Ten]; Nsmutableurlrequest*request = [Client Requestwithmethod:@"POST"Path:@"App_login.do?app=0&action=login"Parameters:params]; Request.timeoutinterval = -;

IOS afnetworking setting Time-out

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.