Re: Editing NSTableViews
Re: Editing NSTableViews
- Subject: Re: Editing NSTableViews
- From: Elisabeth Freeman <email@hidden>
- Date: Sat, 27 Sep 2003 22:04:24 -0700
Below is a snippet from the list archives regarding editing table
views. It seems very clear that one must select the row prior to
editing. However, I've seen examples of programs where it's obvious
that the row is *not* being selected while it's being edited - a good
example, is the outline view used for playlists in iTunes. Select one
playlist, then add another - you can edit and change the name of the
new one but the first one remains selected. Perhaps it requires
overriding the editColumn method? Any thoughts? I writing an app
where it is vital that I be able to keep the current selection, but
allow addition of a new item in the outline view. Any ideas on this
would be much appreciated.
Thanks, Elisabeth
FROM: matt neuburg
DATE: 2003-07-19 18:12
On Thu, 17 Jul 2003 10:13:49 -0700, The Amazing Llama <<EMAIL REMOVED>>
said:
>
I was implementing an NSTableView, and I needed a button to add an
>
entry to the table and set it up to be edited.
>
>
So I found the method
>
>
[categoryTable editColumn:1 row:newRow withEvent:nil select:YES];
>
>
And I went about using it. Then I got an error:
>
>
Invalid parameter not satisfying: _lastSelectedRow == row
>
>
Interesting. So I changed my code to:
>
>
[categoryTable selectRow:newRow byExtendingSelection:NO];
>
[categoryTable editColumn:1 row:newRow withEvent:nil select:YES];
>
>
And it works fine. It wasn't that hard to figure out, but:
>
1) I couldn't find an answer in the mailing list archive, so I
wanted
>
to put one there
>
2) Why doesn't the method just select the row by itself? Why do I
need
>
to do that for it?
The docs say very clearly and loudly:
"The row at rowIndex must be selected prior to calling
editColumn:row:withEvent:select:, or an exception
will be raised."
So what's the problem? The command does what the docs say it does. Is
the
"amazing" feature of this llama the fact that it doesn't know how to
read
the manual? m.
--------
matt neuburg, phd = <EMAIL REMOVED>,
http://www.tidbits.com/matt
_______________________________________________
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.