On Jun 5, 2011, at 9:20 AM, Bing Li wrote:

>        // This line does not work.
> //      [[[NSNotificationQueue alloc]
> initWithNotificationCenter:[NSNotificationCenter defaultCenter]]
> enqueueNotification:[NSNotification
> notificationWithName:@"CONNECTION_DISCONNECTED"
> object:self userInfo:connectionDisconnectedDictionary]
> postingStyle:NSPostWhenIdle];

Weird; that should work. It’s been a few years since I used delayed 
notifications like this, but they worked fine for me in a Cocoa app.

The only thing I can imagine is that maybe in your real code the 
NSNotificationQueue instance is getting dealloced before it can post its 
notifications. Are you sure you’re managing its refcount so it stays alive?

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to