• 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
How to get observe KVO changes to *every* key for an object?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to get observe KVO changes to *every* key for an object?


  • Subject: How to get observe KVO changes to *every* key for an object?
  • From: Dan Wood - Discussion Lists <email@hidden>
  • Date: Fri, 13 May 2005 21:37:59 -0700

I have a class with lots of properties that are modified with an inspector using bindings. I need to observe changes to *all* of the keys to have my view refresh itself (in a non-bindings way). The obvious way is to, for every single property, hook up my observer with addObserver:forKeyPath:options:context: -- but doing so is a hassle (there are a lot of properties to deal with -- I'd hate to lose one) and in fact, because of the way that my class hierarchy works, there are potentially even more properties that should trigger a change if I subclass my model object!

So I'm wondering if anybody has any suggestions to essentially capture & observer *any* property change to the object ... like [self addObserver:self forKeyPath:@"*" ...] or some sort of interception of setValue:forKey: or such?

Thanks.....
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How to get observe KVO changes to *every* key for an object?
      • From: Sherm Pendley <email@hidden>
  • Prev by Date: Re: NSOutlineViews and C++ objects
  • Next by Date: Re: FSCopyObjectAsync: useless and crippled
  • Previous by thread: [ANN] IsingCocoa - simulation of the Ising model for ferromagnetic material
  • Next by thread: Re: How to get observe KVO changes to *every* key for an object?
  • Index(es):
    • Date
    • Thread