Skip to content

Commit

Permalink
Fix crash during Archiving project in IOS
Browse files Browse the repository at this point in the history
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 344c205
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Libraries/Image/RCTImageCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#import <React/RCTConvert.h>
#import <React/RCTNetworking.h>
#import <React/RCTUtils.h>
#import <React/RCTResizeMode.h>

#import "RCTImageUtils.h"

Expand All @@ -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
Expand All @@ -36,7 +37,7 @@ - (instancetype)init
{
_decodedImageCache = [NSCache new];
_decodedImageCache.totalCostLimit = 5 * 1024 * 1024; // 5MB

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(clearCache)
name:UIApplicationDidReceiveMemoryWarningNotification
Expand All @@ -45,7 +46,7 @@ - (instancetype)init
selector:@selector(clearCache)
name:UIApplicationWillResignActiveNotification
object:nil];

return self;
}

Expand Down

0 comments on commit 344c205

Please sign in to comment.