AFURLSessionManager

2017-01-16  本文已影响59人  wyymaomi

AFURLSessionManager creates and manages an NSURLSession object based on a specified NSURLSessionConfiguration object, which conforms to <NSURLSessionTaskDelegate>, <NSURLSessionDataDelegate>, <NSURLSessionDownloadDelegate>, and <NSURLSessionDelegate>.

Subclassing Notes

This is the base class for AFHTTPSessionManager, which adds functionality specific to making HTTP requests. If you are looking to extend AFURLSessionManager specifically for HTTP, consider subclassing AFHTTPSessionManager instead.

NSURLSession & NSURLSessionTask Delegate Methods

AFURLSessionManager implements the following delegate methods:

NSURLSessionDelegate

NSURLSessionTaskDelegate

NSURLSessionDataDelegate

NSURLSessionDownloadDelegate

If any of these methods are overridden in a subclass, they must call the super implementation first.

Network Reachability Monitoring

Network reachability status and change monitoring is available through the reachabilityManager property. Applications may choose to monitor network reachability conditions in order to prevent or suspend any outbound requests. See AFNetworkReachabilityManager for more details.

NSCoding Caveats

NSCopying Caveats

@warning Managers for background sessions must be owned for the duration of their use. This can be accomplished by creating an application-wide or shared singleton instance.

上一篇下一篇

猜你喜欢

热点阅读