• 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: postNotificationName Executes Many Times for a Single Invocation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: postNotificationName Executes Many Times for a Single Invocation


  • Subject: Re: postNotificationName Executes Many Times for a Single Invocation
  • From: Graham Cox <email@hidden>
  • Date: Mon, 06 Jun 2011 23:46:06 +1000

On 06/06/2011, at 11:40 PM, Bing Li wrote:

> The log is shown as follows similarly. This log tells a single invocation
> got three notifications. Why?


Probably because you subscribed to the same notification three times.

The notification center doesn't bother to work out that you've already asked for a given notification from a given target, it just adds it to its list of subscribers. If that contains the same object three times, it gets called three times.

--Graham


_______________________________________________

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: postNotificationName Executes Many Times for a Single Invocation
      • From: Bing Li <email@hidden>
References: 
 >postNotificationName Executes Many Times for a Single Invocation (From: Bing Li <email@hidden>)

  • Prev by Date: postNotificationName Executes Many Times for a Single Invocation
  • Next by Date: Re: iOS: Automatically resizing subviews
  • Previous by thread: postNotificationName Executes Many Times for a Single Invocation
  • Next by thread: Re: postNotificationName Executes Many Times for a Single Invocation
  • Index(es):
    • Date
    • Thread