停止NSURLConnection的sendAsynchronousRequest缓存响应

3

我打电话

[NSURLConnection sendAsynchronousRequest:request
                                   queue:queue
                       completionHandler:^(NSURLResponse * response, NSData *data, NSError *error)

使用设置了cachePolicyNSURLRequestReloadIgnoringLocalCacheData的请求,是否会缓存响应?如果有缓存,我如何确保它不会缓存?我知道它不会从缓存中检索任何东西,但我想确保它也不会留下任何东西。我找不到明确的答案。

1个回答

2

如何使用基于块的API实现委托? - ahwulf
看起来我需要切换到使用 - (id)initWithRequest:(NSURLRequest *)request delegate:(id < NSURLConnectionDelegate >)delegate。 - ahwulf
1
我找到了这个:https://github.com/briancollins/BCURLConnection,它实现了iOS 4的异步调用,但适应我的需要很有用。 - ahwulf

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接