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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to