On May 15, 2011, at 5:31 PM, Bing Li wrote:

> An object, WorkingApp, prints a line and posts a notification as follows.
> 
>    import "WorkingApp.h"
> 
>    @implementation WorkingApp
> 
>    - (void) Print
>    {
>        NSLog(@"I am doing a tough job!");
>        [[NSNotificationCenter defaultCenter] postNotificationName:@"Done"
> object:self];
>    }
> 
>    @end
> 
> 

>   - (void) setUpNotification: (NSString *) notification withSelector:
> (SEL) methodName
>    {
>        [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self
> selector:methodName name:notification object:nil];
>    }

Why are you adding the observer to NSWorkspace's notification center, as 
opposed to NSNotificationCenter's default center (where you are posting the 
notification)?


_______________________________________________

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

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

Reply via email to