Re: DoubleClick and Bindings in an NSTableView (Pre 10.4)
Re: DoubleClick and Bindings in an NSTableView (Pre 10.4)
- Subject: Re: DoubleClick and Bindings in an NSTableView (Pre 10.4)
- From: Daniel Jalkut <email@hidden>
- Date: Tue, 25 Oct 2005 00:09:31 -0400
Hi Josh - thanks for responding. That's an interesting approach, but
I have a few concerns:
1. It may happen to work well on your table if you only allow one
item to be selected at a time, but it will become unreliable if you
decide to allow multiple selection.
2. It's not completely safe to assume that the item that was just
double-clicked is now selected, even in a table that allows only
single item selection. It may be "safe" if you always require a
selection, but you're dealing with a lot of "ifs." What happens if
the user holds down the command key while double clicking a
(previously unselected) item in your table?
I think if I'm going to try to match up the user's click with the
associated item, it's better to use the clicked row number as I'm doing.
Daniel
On Oct 24, 2005, at 6:16 PM, Josh Burnett wrote:
I use [NSArrayController selectedObjects] and just grab the first
(and only) item out of the array. Here's how I do it right now:
NSArrayController* tableController = [sender contentController];
id currentObject = [[tableController selectedObjects]
objectAtIndex:0];
Sure, you're using the NSArrayController, but you're asking it
which one is actually being selected, not just matching the table's
selected row with an object in the array returned by arrangedObjects.
_______________________________________________
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