Re: NSWorkspace notifications related to time change
Re: NSWorkspace notifications related to time change
- Subject: Re: NSWorkspace notifications related to time change
- From: Carl Hoefs via Cocoa-dev <email@hidden>
- Date: Wed, 18 Dec 2019 12:10:17 -0700
> On Dec 18, 2019, at 11:35 AM, James Walker via Cocoa-dev
> <email@hidden> wrote:
>
> On 12/18/19 9:55 AM, Carl Hoefs via Cocoa-dev wrote:
>
>> However, I cannot get this notification to fire on system time changes. My
>> other notifications (such as sleep wake, etc) do fire.
>> -Carl
>> [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver: self
>> selector: @selector(systemTimeChanged:)
>> name: NSSystemClockDidChangeNotification object: NULL];
>> -(void) systemTimeChanged: (NSNotification *) notification
>> {
>> NSLog(@"-systemTimeChanged: %@", [notification name]);
>> }
>
> I'm not sure what that workspace notification center is for. Maybe try
> [NSNotificationCenter defaultCenter].
Thanks for the suggestion. Apple docs have [[[NSWorkspace sharedWorkspace]
notificationCenter] in their code snippets. But [NSNotificationCenter
defaultCenter] doesn't work either. Very odd. Might there be some way in Xcode
or Console to see what notifications are being fired?
-Carl
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden