• 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: Stupid objective-c question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Stupid objective-c question (From: Gabriel Zachmann <email@hidden>)
 >Re: Stupid objective-c question (From: Graham Cox <email@hidden>)
 >Re: Stupid objective-c question (From: Quincey Morris <email@hidden>)
 >Re: Stupid objective-c question (From: Graham Cox <email@hidden>)
 >Re: Stupid objective-c question (From: Doug Hill <email@hidden>)
 >Re: Stupid objective-c question (From: Jens Alfke <email@hidden>)
 >Re: Stupid objective-c question (From: Gabriel Zachmann <email@hidden>)
 >Re: Stupid objective-c question (From: Quincey Morris <email@hidden>)
 >Re: Stupid objective-c question (From: Gabriel Zachmann <email@hidden>)

  • Prev by Date: Re: MLMediaLibrary sometimes does not call my KVO
  • Next by Date: Re: Stupid objective-c question
  • Previous by thread: Re: Stupid objective-c question
  • Next by thread: Re: Stupid objective-c question
  • Index(es):
    • Date
    • Thread