Adding and editing a multi column row in NSTableView
Adding and editing a multi column row in NSTableView
- Subject: Adding and editing a multi column row in NSTableView
- From: email@hidden
- Date: Thu, 07 Jul 2011 13:54:51 +0000
I have an NSTableView whose columns are bound to an NSArrayController. The
data displays correctly in the table and I can edit the individual cells;
all good there. But, when I programmatically add a new item to the
controller, a new row is added at the bottom of the table. This is not what
I want, so instead of using NSArrayController's addObject: method, I use
-insertObject:AtArrangedObjectIndex:. This causes the new row to be
inserted at the top of the table view, which is what I want, but when I
edit the first column and tab to the second column (three columns in all,
only 1 & 2 are editable), the selection jumps to the last row in the table
and the second column is made editable. I've looked at a couple of the
NSTableViewDelegate methods to try to figure out why this happens, but am
at a loss. I even tried inserting into index 0 of the proxy object returned
via mutableArrayValueForKey, but the behavior is the same. So how do I
accomplish what I want?
Thx
_______________________________________________
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