Skip to content

Commit a54cfd9

Browse files
committed
Fixed issues with macOS
1 parent c1f62db commit a54cfd9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Sources/EGOCache.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@
2727
#import <Foundation/Foundation.h>
2828

2929
#if TARGET_OS_IPHONE
30-
#import <UIKit/UIKit.h>
30+
#import <UIKit/UIKit.h>
31+
#endif
32+
33+
#if TARGET_OS_OSX
34+
#import <AppKit/AppKit.h>
3135
#endif
3236

3337
//! Project version number for EGOCache.

Sources/EGOCache.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ - (void)setImage:(NSImage*)anImage forKey:(NSString*)key {
320320
}
321321

322322
- (void)setImage:(NSImage*)anImage forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval {
323-
[self setData:[[[anImage representations] objectAtIndex:0] representationUsingType:NSPNGFileType properties:nil] forKey:key withTimeoutInterval:timeoutInterval];
323+
[self setData:[[NSBitmapImageRep imageRepWithData:anImage.TIFFRepresentation] representationUsingType:NSPNGFileType properties:@{ }] forKey:key withTimeoutInterval:timeoutInterval];
324324
}
325325

326326
#endif

0 commit comments

Comments
 (0)