Created
February 14, 2014 21:36
-
-
Save tomkrcha/9009845 to your computer and use it in GitHub Desktop.
Detect if Mac OSX space changed in cocoa - NSWorkspaceActiveSpaceDidChangeNotification change / event / notification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation AppDelegate | |
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification | |
{ | |
NSNotificationCenter *nc = [[NSWorkspace sharedWorkspace] notificationCenter]; | |
[nc addObserver:self | |
selector:@selector(spaceChanged:) | |
name:NSWorkspaceActiveSpaceDidChangeNotification | |
object:[NSWorkspace sharedWorkspace]]; | |
NSLog(@"applicationDidFinishLaunching"); | |
} | |
- (void)spaceChanged:(NSNotification *)aNotification{ | |
NSLog(@"spaceChanged"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment