Permalink
Browse files

Fix crash during Archiving project in IOS

Summary:
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.

  To fix issue that crash on XCode 9.3

Archive the project in XCode 9.3

This does not change any documentation

 To fix issue that crash on XCode 9.3

 [IOS] [BREAKING] [RCTImageCache.m] - Crash during archiving in XCode 9.3
Closes #18682

Differential Revision: D7992071

Pulled By: hramos

fbshipit-source-id: 1089e469712b1eb2fcdd3ad59766c187e932f46c
  • Loading branch information...
fattahmuhyiddeen authored and facebook-github-bot committed May 14, 2018
1 parent 07df365 commit 344c205070d5ad670c97984dd86ec9ac13c73f81
Showing with 5 additions and 4 deletions.
  1. +5 −4 Libraries/Image/RCTImageCache.m
@@ -14,6 +14,7 @@
#import <React/RCTConvert.h>
#import <React/RCTNetworking.h>
#import <React/RCTUtils.h>
#import <React/RCTResizeMode.h>
#import "RCTImageUtils.h"
@@ -22,8 +23,8 @@
static NSString *RCTCacheKeyForImage(NSString *imageTag, CGSize size, CGFloat scale,
RCTResizeMode resizeMode, NSString *responseDate)
{
return [NSString stringWithFormat:@"%@|%g|%g|%g|%lld|%@",
imageTag, size.width, size.height, scale, (long long)resizeMode, responseDate];
return [NSString stringWithFormat:@"%@|%g|%g|%g|%lld|%@",
imageTag, size.width, size.height, scale, (long long)resizeMode, responseDate];
}
@implementation RCTImageCache
@@ -36,7 +37,7 @@ - (instancetype)init
{
_decodedImageCache = [NSCache new];
_decodedImageCache.totalCostLimit = 5 * 1024 * 1024; // 5MB
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(clearCache)
name:UIApplicationDidReceiveMemoryWarningNotification
@@ -45,7 +46,7 @@ - (instancetype)init
selector:@selector(clearCache)
name:UIApplicationWillResignActiveNotification
object:nil];
return self;
}

0 comments on commit 344c205

Please sign in to comment.