Re: reading NSTableView cell edits before user tabs or enters
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