From 84d18cac753a676e25be5273c7b935cfdd8e35d4 Mon Sep 17 00:00:00 2001 From: flutechang Date: Wed, 29 Jun 2016 10:33:09 -0700 Subject: [PATCH] Fix crash around customizing NSURLCache size. --- UIKit+AFNetworking/AFImageDownloader.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/UIKit+AFNetworking/AFImageDownloader.m b/UIKit+AFNetworking/AFImageDownloader.m index 136e1fe5bd..105feee4f2 100644 --- a/UIKit+AFNetworking/AFImageDownloader.m +++ b/UIKit+AFNetworking/AFImageDownloader.m @@ -110,6 +110,9 @@ @interface AFImageDownloader () @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"];