• 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
NSTableView, undo, bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTableView, undo, bindings


  • Subject: NSTableView, undo, bindings
  • From: m <email@hidden>
  • Date: Sat, 6 Nov 2004 14:22:21 -0800

I have a table view bound to an array controller. The model is an array of dictionaries. The values in the dictionaries can be edited by double clicking in a table cell and changing the text. That all works very nicely.

I'm trying to figure out the most straightforward way to implement undo. I tried overriding the array controller's observeValueForKeyPath:ofObject:change:context: method, and it does get called when the user changes a data value in the table, but the change dictionary argument is always nil, so I don't know what the "before" value of the data was.

Whether a change dictionary is passed to the array controller's observeValueForKeyPath:ofObject:change:context: method depends on the options passed to the dictionary's addObserver:forKeyPath:options:context: method when the controller registered as an observer. Is there some way to change the observer options after the observer relationship is established? Or am I going about this in completely the wrong way?

_murat

_______________________________________________
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


  • Prev by Date: Cell selection and scrolling
  • Next by Date: Re: [solved] newbie "can't find method"
  • Previous by thread: Cell selection and scrolling
  • Next by thread: Re: NSTableView, undo, bindings
  • Index(es):
    • Date
    • Thread