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 protected]) 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 [email protected]
