With AFNetworking
you usually enqueue operations by doing the following:
[_httpClient enqueueHTTPRequestOperation:operation];
Is there a way to serialize or save the queue so it can be resumed after App Termination?
With AFNetworking
you usually enqueue operations by doing the following:
[_httpClient enqueueHTTPRequestOperation:operation];
Is there a way to serialize or save the queue so it can be resumed after App Termination?
实际上,如果您查看AFURLConnectionOperation
它实现了NSCoding
协议,并且.m
文件通过实现initWithCoder:
和encodeWithCoder:
方法反映了这一点
尽管AFHTTPClient
基类也NSCoding
兼容,但它不会序列化队列本身
但是没有什么能阻止您利用现有的代码库并扩展编码/解码功能来序列化您的自定义子类中的队列操作AFHTTPClient
希望这是有道理的!