浏览代码

Fix crash around customizing NSURLCache size.

flutechang 9 年之前
父节点
当前提交
84d18cac75
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      UIKit+AFNetworking/AFImageDownloader.m

+ 3 - 0
UIKit+AFNetworking/AFImageDownloader.m

@@ -110,6 +110,9 @@
 @implementation AFImageDownloader
 
 + (NSURLCache *)defaultURLCache {
+    if ([[[UIDevice currentDevice] systemVersion] compare:@"8.2" options:NSNumericSearch] == NSOrderedAscending) {
+        return [NSURLCache sharedURLCache];
+    }
     return [[NSURLCache alloc] initWithMemoryCapacity:20 * 1024 * 1024
                                          diskCapacity:150 * 1024 * 1024
                                              diskPath:@"com.alamofire.imagedownloader"];