I need that because the last object selected is the one I represent in the Inspector panel (instead of "Multiple Selection" which is not editable). So for example the last object selected has coords x = 30 and y = 50 and I show these coords on the Inspector.
This info lets me do so nice tasks. e.g: With all the objects selected, and the last object selected being represented on the Inspector panel (x = 30), I can enter a value X = 35 then all the objects will be translated by X = 5. To do that I have to know what the user really selected as last. I noticed that if I select a row with "byExtendingSelection:YES", I can retrieve the last selected row with selectedRow. But with selectRowIndexes:indexSet byExtendingSelection:NO I lose the last selected row. This is (even) the case of deselecting a row programmatically because there is not an API like deselectRowIndexes:indexSet To deselect programmatically I have to remove the indexRow from the indexSet and call selectRowIndexes:indexSet byExtendingSelection:NO so I lose the last selected row. I could try to use an NSArrayController. -- LL > Da: Kyle Sluder <kyle.slu...@gmail.com> > Data: Wed, 14 Oct 2009 09:44:00 -0700 > A: "gMail.com" <mac.iphone....@gmail.com> > Cc: <cocoa-dev@lists.apple.com> > Oggetto: Re: SelectedRowIndexes > > On Wed, Oct 14, 2009 at 8:55 AM, gMail.com <mac.iphone....@gmail.com> wrote: >> Instead I need to sort it as the selection order. > > I'm kind of curious (not, I must emphasize, incredulous) as to why you > need this. Wouldn't it be better to record the order in which > selections were made in the controller layer, not in the view? You > could bind selectionIndexes to a property on a controller that knows > how to record selection history. > > --Kyle Sluder _______________________________________________ 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