• 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
Intercepting user changes to table cells using bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Intercepting user changes to table cells using bindings


  • Subject: Intercepting user changes to table cells using bindings
  • From: BareFeet <email@hidden>
  • Date: Thu, 10 Sep 2009 16:09:56 +1000

Hi all,

I have a table view with columns bound to an NSArrayController. The user can edit the values that appear and it's all working fine.

I have a class called "DataRow" for each row in the table/controller. Each DataRow is essentially an NSMutableDictionary with a key for each column name. The column names (and therefore dictionary keys) are dynamically built according to imported data.

What is the best way to intercept user changes to cells in the table? I might want to just record the changes or allow/disallow them.

One way, I figure, is to use this method in my DataRow class:

- (void) setValue:(id)value forKeyPath:(NSString*)keyPath
{
	NSLog(@"DataRow setValue:forKeyPath:%@", keyPath);
	return [super setValue:(id)value forKeyPath:(NSString*)keyPath];
}

This gives the keyPath as: dataRow.The Column Name of the Edited Cell

Is there a built in way to extract the column name (same at the dictionary key), or should I just parse out based on the delimiting "." and hope there are no "." in the name?

Or is there a better way altogether to intercept data entry changes?

Thanks,
Tom
BareFeet

_______________________________________________

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: Intercepting user changes to table cells using bindings
      • From: Sean Kline <email@hidden>
  • Prev by Date: [MEET] CocoaHeads-NYC tonight, Sept. 10, 6:00
  • Next by Date: Re: NSArray EXEC_BAD_ACCESS when initalized with strings
  • Previous by thread: [MEET] CocoaHeads-NYC tonight, Sept. 10, 6:00
  • Next by thread: Re: Intercepting user changes to table cells using bindings
  • Index(es):
    • Date
    • Thread