Hi Gerriet.

You need to use the option NSNotificationPostToAllSessions.

-Jeff


On Sep 15, 2013, at 12:15 PM, Gerriet M. Denkmann <gerr...@mdenkmann.de> wrote:

> I have a Helper Tool, running as root, started via SMJobBless and 
> communicating vie Xpc.
> 
> Sometimes it does:
> 
> [[NSOperationQueue mainQueue] addOperationWithBlock:^
>       {
>               NSDistributedNotificationCenter *d = [ 
> NSDistributedNotificationCenter defaultCenter ];
>               NSLog(@"%s will postNotificationName on %@",__FUNCTION__,d);    
>               //      prints: <CFNotificationCenter 0x7f9f....
>               NSDictionary *notificationInfo = ....
>               [ d             postNotificationName:   @"some notification" 
>                               object:                                         
> @"some name" 
>                               userInfo:                               
> notificationInfo 
>               ];
>       }
> ];
> 
> But now one ever receives this.
> 
> This used to work before I switched to SMJobBless and Xpc.
> 
> Why is this not working anymore?
> 
> Gerriet.
> 
> P.S. I did not see anything in the documentation indicating that the 
> NSDistributedNotificationCenter does only work on the main thread.
> This is just some blind groping in the dark.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to