Skip to content

Commit

Permalink
Added notification subscription for mac
Browse files Browse the repository at this point in the history
  • Loading branch information
MugunthKumar committed Jan 30, 2012
1 parent dc0a852 commit aec699c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion MKNetworkKit/MKNetworkEngine.m
Expand Up @@ -531,7 +531,15 @@ -(void) useCache {

#elif TARGET_OS_MAC

#warning POSSIBLY INCOMPLETE FUNCTION (Subscribe to Mac related notification for serializing caches)
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(saveCache)
name:NSApplicationWillHideNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(saveCache)
name:NSApplicationWillResignActiveNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(saveCache)
name:NSApplicationWillTerminateNotification
object:nil];

#endif

Expand Down

0 comments on commit aec699c

Please sign in to comment.