NSURLRequest缓存问题iOS 7 [英] NSURLRequest cache issue iOS 7

查看:111
本文介绍了NSURLRequest缓存问题iOS 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

cachePolicy不起作用,它只是缓存下载的json。

in iOS 7 cachePolicy doesn't work, it just cache the downloaded json.

//URLRequest
        NSString *url = [NSString stringWithFormat:@"http://www.semhora.com/jsonparser/categories/categories_%d_test.json", _categoriesIndex];
        NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:url]
                                                  cachePolicy:NSURLCacheStorageNotAllowed
                                          timeoutInterval:60.0];

如何在iOS 7中禁止缓存?

How can I disallow cache in iOS 7?

推荐答案

我刚刚使用过:

//URLRequest
        NSString *url = [NSString stringWithFormat:@"http://www.semhora.com/jsonparser/categories/categories_%d_test.json", _categoriesIndex];
        NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:url]
                                                  cachePolicy:0
                                          timeoutInterval:60.0];

现在它有效,从苹果开发论坛得到任何答案,直到现在它为什么会发生。

And now it works, got any answer from apple dev forum until now why it happens.

这篇关于NSURLRequest缓存问题iOS 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆