• 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: reading NSTableView cell edits before user tabs or enters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reading NSTableView cell edits before user tabs or enters


  • Subject: Re: reading NSTableView cell edits before user tabs or enters
  • From: Joshua Emmons <email@hidden>
  • Date: Fri, 16 Nov 2007 10:15:34 -0600

I can trap THAT A CELL HAS CHANGED with controlTextDidChange. The problem is that I don't know the mechanism for reading active cell edits before the user tabs or enters (i.e. the content of the changes)

That's because, until tab or enter or whatever is pressed, the value is not actually in your cell. It's in the field editor that's editing your cell. I think you should be able to ask the field editor for its value... you can get ahold of it using:


[myWindow fieldEditor:NO forObject:nil]

BUT if you just want to get this value so you can commit it before saving, an easier solution would be to take focus away from the edited cell before saving. This will automatically cause the filed editor to commit its value to the cell and the proper data will get saved.

[myWindow makeFirstResponder:nil]

should do the trick. It will send a -resignFirstResponder to the current first responder (in this case, the field editor).

Cheers,
-Joshua Emmons
_______________________________________________

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


References: 
 >reading NSTableView cell edits before user tabs or enters (From: Randy Hulett <email@hidden>)

  • Prev by Date: Re: reading NSTableView cell edits before user tabs or enters
  • Next by Date: re: CoreImage problems with very large images
  • Previous by thread: Re: reading NSTableView cell edits before user tabs or enters
  • Next by thread: row numbers participating in a table drag
  • Index(es):
    • Date
    • Thread