Re: [tableView deselectAll:nil] - is this a good way to deselect a tableView?
Re: [tableView deselectAll:nil] - is this a good way to deselect a tableView?
- Subject: Re: [tableView deselectAll:nil] - is this a good way to deselect a tableView?
- From: Matt Neuburg <email@hidden>
- Date: Sun, 25 Aug 2002 20:22:31 -0700
On Sun, 25 Aug 2002 13:52:09 -0400, Michael Zornek
<email@hidden> said:
>
We are told to enable a multiple select delete IBAction and for the most
>
part I got it done well. But prob was if you created three rows:
>
>
Aaa
>
Bbb
>
Ccc
>
>
Then selected "Ccc" and "Aaa" hit the delete button, those two would go away
>
and "Bbb" would be selected.
>
Isn't it good UI not to auto select anymore rows?
I don't think so. In general if I'm working via keyboard in an area of an
outline or table and I delete, I'd like to still be working in that area. I
don't want to have to grab the mouse and select in order to work more. Thus
I'd something to be selected - in particular, whatever rose up into the
area left empty by the deletion (as it were). That's exactly what Cocoa
does.
I think the way for you to look at this is to consider that Cocoa gives you
a default behavior that solves the *hard* problem for you. It would be a
lot of work to implement this select-after-delete behavior yourself, so
Cocoa kindly gives it to you. Whereas, imagine if the assignment were the
other way round - that is, suppose Cocoa selected nothing after the delete,
and *you* had to write the code to save a knowledge of the selection
beforehand and select intelligently afterward. That would be a lot of work!
Instead, to do what you've decided (rightly or wrongly) to do is one *easy*
line of code, a line of code that you've rightly given:
>
[tableView deselectAll:nil];
m.
--
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
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.