Forráskód Böngészése

Fix crash around customizing NSURLCache size.

flutechang 9 éve
szülő
commit
84d18cac75
1 módosított fájl, 3 hozzáadás és 0 törlés
  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"];