iOS 缓存NSURLCache

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];

你可能感兴趣的:(iOS 缓存NSURLCache)