1.在appdelegate中添加,在每个模块添加这段代码的时候,缓存没有成功。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
CustomURLCache *urlCache = [[CustomURLCache alloc] initWithMemoryCapacity:20 * 1024 * 1024
diskCapacity:200 * 1024 * 1024
diskPath:nil
cacheTime:0];
[CustomURLCache setSharedURLCache:urlCache];
原文:http://my.oschina.net/u/585206/blog/492115