iOS 缓存NSURLCache

1.在appdelegate中添加,在每一个模块添加这段代码的时候,缓存没有成功。缓存

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {app

    // Override point for customization after application launch.ide

    CustomURLCache *urlCache = [[CustomURLCache alloc] initWithMemoryCapacity:20 * 1024 * 1024url

                                                                 diskCapacity:200 * 1024 * 1024spa

                                                                     diskPath:nilorm

                                                                    cacheTime:0];ci

    [CustomURLCache setSharedURLCache:urlCache];it