• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: SelectedRowIndexes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SelectedRowIndexes


  • Subject: Re: SelectedRowIndexes
  • From: "gMail.com" <email@hidden>
  • Date: Thu, 15 Oct 2009 01:45:07 +0200
  • Thread-topic: SelectedRowIndexes

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 <email@hidden>
> Data: Wed, 14 Oct 2009 09:44:00 -0700
> A: "gMail.com" <email@hidden>
> Cc: <email@hidden>
> Oggetto: Re: SelectedRowIndexes
>
> On Wed, Oct 14, 2009 at 8:55 AM, gMail.com <email@hidden> 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 (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

  • Follow-Ups:
    • Re: SelectedRowIndexes
      • From: Kyle Sluder <email@hidden>
References: 
 >Re: SelectedRowIndexes (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Help with NSURLConnection memory fault
  • Next by Date: Re: SelectedRowIndexes
  • Previous by thread: Re: SelectedRowIndexes
  • Next by thread: Re: SelectedRowIndexes
  • Index(es):
    • Date
    • Thread