Re: NSTableView return key and editing
Re: NSTableView return key and editing
- Subject: Re: NSTableView return key and editing
- From: Just van Rossum <email@hidden>
- Date: Fri, 23 May 2003 11:47:58 +0200
[following up to myself]
>
Inelegant, yes, but the solution just posted by Christopher Corbell
>
seems even less elegant.
Sorry, I meant code-wise; it's quite likely that his solution is more
elegant UI-wise.
>
I had good results by doing this (transcribed
>
from Python, so apologies for any ObjC mistakes):
>
>
- (void)tableView:(NSTableView*)tableView setObjectValue:(id)newObj
>
forTableColumn:(NSTableColumn*)col row:(int)row
>
{
>
...update model...
>
[self performSelector:forceEndEditing withObject:tableView
>
afterDelay: 0];
>
}
This probably should rather be:
- (void)tableView:(NSTableView*)tableView setObjectValue:(id)newObj
forTableColumn:(NSTableColumn*)col row:(int)row
{
...update model...
if (...sort order has changed...) {
[tableView reloadData];
[self performSelector:forceEndEditing withObject:tableView
afterDelay: 0];
}
}
Also, I found out if you don't deselect all in forceEndEditing but
select the proper row, the delay should be longer than 0.
Just
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.