• 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: Setting the selection of an array controller?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting the selection of an array controller?


  • Subject: Re: Setting the selection of an array controller?
  • From: Rick Mann <email@hidden>
  • Date: Fri, 25 Mar 2011 18:01:12 -0700

On Mar 25, 2011, at 5:35 PM, Quincey Morris wrote:

> On Mar 25, 2011, at 17:13, Rick Mann wrote:
>
>> I've got examples working where the selection is managed by Cocoa, but I don't know how to set it myself.
>
> Use some combination of:
>
> 	[arrayController setSelectionIndex: someIndex];
> 	[arrayController setSelectionIndexes: someIndexSet];
> 	[arrayController addSelectionIndexes: someIndexSet];
> 	[arrayController removeSelectionIndexes: someIndexSet];

Part of the problem I had was that I don't have indices readily available. I have the objects themselves, and I could look them up in the array, but that strikes me as potentially slow (for a lot of objects).

It could just be that I'm uncomfortable working with the NSArrayController in code still.

> On Mar 25, 2011, at 17:26, Rick Mann wrote:
>
>> Right after sending this email, I think I found a good example: Graphics Bindings
>>
>> 	http://homepage.mac.com/mmalc/CocoaExamples/controllers.html
>
> Trust me, you aren't going to want to do this with bindings, not the selection is controlled from a custom view.

I think there's a typo there, so I'm not quite sure what you're telling me. In fact, I will eventually have both a custom control in the inspector, and the view in which the selection is managed by the user is custom.

--
Rick

_______________________________________________

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: Setting the selection of an array controller?
      • From: Quincey Morris <email@hidden>
References: 
 >Setting the selection of an array controller? (From: Rick Mann <email@hidden>)
 >Re: Setting the selection of an array controller? (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Setting the selection of an array controller?
  • Next by Date: Re: Setting the selection of an array controller?
  • Previous by thread: Re: Setting the selection of an array controller?
  • Next by thread: Re: Setting the selection of an array controller?
  • Index(es):
    • Date
    • Thread