huangxiaodong пре 1 година
родитељ
комит
2b0f7718f0
1 измењених фајлова са 12 додато и 0 уклоњено
  1. 12 0
      创维盒子/双子星云手机/AppDelegate/AppDelegate.m

+ 12 - 0
创维盒子/双子星云手机/AppDelegate/AppDelegate.m

@@ -18,6 +18,7 @@
 #import <WXApi.h>
 #import <TencentOpenAPI/QQApiInterface.h>
 #import <TencentOpenAPI/TencentOAuth.h>
+#import <SDWebImage/SDWebImage.h>
 
 @interface AppDelegate ()<JJExceptionHandle,WXApiDelegate>
 {
@@ -127,6 +128,7 @@
     [TencentOAuth setIsUserAgreedAuthorization:YES];
     TencentOAuth *tencentOAuth =[[TencentOAuth alloc] initWithAppId:QQAPPid andUniversalLink:QQUniversalLink andDelegate:self];
     
+    [self imageLoadingSettings];
     return YES;
 }
 
@@ -328,4 +330,14 @@
     }
     return nil;
 }
+
+- (void)imageLoadingSettings {
+    [SDImageCache sharedImageCache].config.maxDiskAge = 3600 * 24 * 7;
+    [SDImageCache sharedImageCache].config.maxMemoryCount = 1024 * 1024 * 20;
+    [SDImageCache sharedImageCache].config.shouldCacheImagesInMemory = NO;
+    //[SDImageCache sharedImageCache].config.shouldDecompressImages = NO;
+    //[SDWebImageDownloader sharedDownloader].shouldDecompressImages = NO;
+    [SDImageCache sharedImageCache].config.diskCacheReadingOptions = NSDataReadingMappedIfSafe;
+}
+
 @end