Re: Using NSNotificationCenter passing an object or value?
Re: Using NSNotificationCenter passing an object or value?
- Subject: Re: Using NSNotificationCenter passing an object or value?
- From: Quincey Morris <email@hidden>
- Date: Tue, 3 Aug 2010 14:09:26 -0700
On Aug 3, 2010, at 13:50, eric dolecki GMail wrote:
> Many thanks. I didn't know object could be nil yet still pass it along when populated
I *knew* you were going to say exactly that. :)
Specifying nil for the 'object:' parameter just means (and I quote from the NSNotificationCenter reference) "the notification center doesn’t use a notification’s sender to decide whether to deliver it to the observer". All notifications still have a sender, available as the 'object' property of the notification object.
If the parameter had been named something like 'objectFilter:' instead, you wouldn't have been confused. As it is, reading the documentation would have cleared up the apparent ambiguity, which is why I keep harping on READING THE DOCUMENTATION.
_______________________________________________
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