• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Asynchronous Notification Does NOT Work
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Asynchronous Notification Does NOT Work


  • Subject: Re: Asynchronous Notification Does NOT Work
  • From: Bing Li <email@hidden>
  • Date: Mon, 06 Jun 2011 02:59:12 +0800

Dear Jens,

I just checked carefully. The instance of NSNotificationQueue keeps alive
when posting.

One issue is that the notification job is done in a thread I created
explicitly. It is the potential reason? I will test it.

Thanks,
Bing

On Mon, Jun 6, 2011 at 1:13 AM, Jens Alfke <email@hidden> wrote:

>
> 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
>
>
_______________________________________________

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

  • Follow-Ups:
    • Re: Asynchronous Notification Does NOT Work
      • From: Jens Alfke <email@hidden>
References: 
 >Asynchronous Notification Does NOT Work (From: Bing Li <email@hidden>)
 >Re: Asynchronous Notification Does NOT Work (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Asynchronous Notification Does NOT Work
  • Next by Date: Re: Asynchronous Notification Does NOT Work
  • Previous by thread: Re: Asynchronous Notification Does NOT Work
  • Next by thread: Re: Asynchronous Notification Does NOT Work
  • Index(es):
    • Date
    • Thread