Re: postNotificationName Executes Many Times for a Single Invocation
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