Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
你能把你的答案分享给我吗
NSURLRequest
timeoutInterval
NSMutableURLRequest
对于 NSURLRequest 和 NSMutableURLRequest 默认 timeoutInterval 时间是 60 秒
默认缓存策略为NSURLRequestUseProtocolCachePolicy,默认超时间隔为 60 秒。
NSURLRequestUseProtocolCachePolicy
NSURLRequest 类参考
也许你可以做一个小测试然后你会知道:
仅供参考 - iOS 6.0 的间隔从 240 更改为 60。
https://developer.apple.com/documentation/foundation/nsmutableurlrequest/1414063-timeoutinterval?language=objc
作为参考,默认超时间隔在 的头文件中定义NSURLRequest,旁边是+requestWithURL:
+requestWithURL:
它明确表示它是60 seconds。