Re: Stupid objective-c question
Re: Stupid objective-c question
- Subject: Re: Stupid objective-c question
- From: Jens Alfke <email@hidden>
- Date: Thu, 22 Sep 2016 16:09:49 -0700
> On Sep 22, 2016, at 3:45 PM, Gabriel Zachmann <email@hidden> wrote:
>
> I don't see why that should not be possible in Obj-C - I just would need a mechanism to add tell the system the names / function pointers to be registered as observers.
That’s more like the way NSNotificationCenter works — you specify the target and selector, which together act similarly to a function pointer.
I’m not sure why, but KVO uses a single method to deliver all notifications. That’s just the way Apple designed it, and KVO is newer than NSNotificationCenter so they must have had a good reason for doing so. That means the only thing that can uniquely distinguish different KVO registrations is the ‘context’ value.
—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