• 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
addObserver:forKeyPath:options:context
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

addObserver:forKeyPath:options:context


  • Subject: addObserver:forKeyPath:options:context
  • From: Eric Long <email@hidden>
  • Date: Mon, 17 Apr 2006 11:02:54 -0700

Hi,

I have a master/detail interface that is working well overall with bindings.
I have an array of objects the user can edit individually.  I want to know
when the user has changed an object's value so I can enable my "Save
Changes" button.

I don't understand how to use the addObserver:forKeyPath:options:context to
allow my UI controller to observe when a property of any object in my
objects array has changed.  There's no key path I can watch for the array,
since array items are referenced by index.  It seems kind of ridiculous to
iterate the array and register individually for each object.  I'm thinking
there must be a better way to do this.

I haven't been able to find sample code that shows a master/detail
implementation that detects changes to the data that must be saved.

What's the right way to do this?


Thanks,


Eric



 _______________________________________________
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: addObserver:forKeyPath:options:context
      • From: Herbert Putteneers <email@hidden>
    • Re: addObserver:forKeyPath:options:context
      • From: Ondra Cada <email@hidden>
    • Re: addObserver:forKeyPath:options:context
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: Reading individual bytes from a string
  • Next by Date: Different context in Core Data
  • Previous by thread: Re: Question on thread communication
  • Next by thread: Re: addObserver:forKeyPath:options:context
  • Index(es):
    • Date
    • Thread