• 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: With What does Apple Swizzle the IsA-pointer in KVO?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: With What does Apple Swizzle the IsA-pointer in KVO?


  • Subject: Re: With What does Apple Swizzle the IsA-pointer in KVO?
  • From: Paul Sargent <email@hidden>
  • Date: Fri, 23 Nov 2007 16:50:47 +0000


KVO is not based on the internals of an object (which is assumed to be hidden), and it does not access hiddden internals. KVO is based on KVC and uses accessors.


To expand a bit, my mental model of it is (and this could be wrong):

No Observing:

ObjA ----setBlah:----> ObjB

Observing:

ObjA ----setBlah:----> ProxyForB -----setBlah:----> ObjB
                           |
                           |
                           \-------blahChanged:---> Observer

i.e. When the observer registers a proxy is inserted in the chain. The message is intercepted by the proxy and it notifies the Observer.

I don't think it's quite like this, but this allows me to understand it enough to use it.

It's also possible for the observed object (ObjB) to send a message to the observer with didChangeValueForKey:

I don't quite see what wanting that you don't have. Is it that you want to know when any key has change, rather that one specific one?
_______________________________________________


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: With What does Apple Swizzle the IsA-pointer in KVO?
      • From: Sherm Pendley <email@hidden>
References: 
 >With What does Apple Swizzle the IsA-pointer in KVO? (From: Philip Mötteli <email@hidden>)
 >Re: With What does Apple Swizzle the IsA-pointer in KVO? (From: "Clark Cox" <email@hidden>)
 >Re: With What does Apple Swizzle the IsA-pointer in KVO? (From: Philip Mötteli <email@hidden>)
 >Re: With What does Apple Swizzle the IsA-pointer in KVO? (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: Having trouble with NSView setNeedsDisplay
  • Next by Date: Problem with WithBindings sample code?
  • Previous by thread: Re: With What does Apple Swizzle the IsA-pointer in KVO?
  • Next by thread: Re: With What does Apple Swizzle the IsA-pointer in KVO?
  • Index(es):
    • Date
    • Thread