From 48037b800987750eb99ccea13b580c2134486d0b Mon Sep 17 00:00:00 2001 From: Alexey Belkevich Date: Thu, 30 Jan 2014 17:03:00 +0200 Subject: [PATCH] Added OS X support --- Classes/Public/APSmartStorage.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Classes/Public/APSmartStorage.m b/Classes/Public/APSmartStorage.m index 5c8a093..71e9a29 100644 --- a/Classes/Public/APSmartStorage.m +++ b/Classes/Public/APSmartStorage.m @@ -33,16 +33,20 @@ - (id)init if (self) { _taskManager = [[APTaskManager alloc] init]; +#if TARGET_OS_IPHONE NSNotificationCenter *center = NSNotificationCenter.defaultCenter; [center addObserver:self selector:@selector(didReceiveMemoryWarning:) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; +#endif } return self; } - (void)dealloc { +#if TARGET_OS_IPHONE [NSNotificationCenter.defaultCenter removeObserver:self]; +#endif } #pragma mark - singleton @@ -212,6 +216,7 @@ - (void)objectFromNetworkWithURL:(NSURL *)url callback:(void (^)(id object, NSEr }]; } +#if TARGET_OS_IPHONE - (void)didReceiveMemoryWarning:(NSNotification *)notification { [self.memoryStorage removeAllObjects]; @@ -219,5 +224,6 @@ - (void)didReceiveMemoryWarning:(NSNotification *)notification _fileStorage = nil; _networkStorage = nil; } +#endif @end