Skip navigation.
 
mlRe: Selecting an object of a NSArrayController
FROM : Hank Heijink
DATE : Fri Jan 04 20:41:04 2008

Since there's only one entity that can be YES, you'd be faster and 
less memory-consuming if you just stored the index of the element that 
has YES, instead of storing YES/NO for every element and then having 
to find the right one.

On Jan 4, 2008, at 2:32 PM, Michael Varlik wrote:

> Hi,
>
> I have an NSArrayController which controles entities.
> These entities have a boolean attribute and there is
> exactly one entitie where this attribute is YES, all
> the others are NO. When I want to select the one entity
> with the attribute set to YES, I iterate through the
> NSArrayController's arrangedObjects and when I find
> the entity, I call setSelectionIndex to the index of
> the object within arrangedObjects.
> This works pretty good, but I wonder if there is a more
> convenient way to perform this, something like
> "selectObjectWithValueForKey". Is there a way to do
> this?
>
> Many thanks in advance,
> Michael
> --
> GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
> Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> 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/hank.list
> %40runbox.com
>
> This email sent to hank.<email_removed>
>


Hank Heijink
hank.<email_removed>

Related mailsAuthorDate
mlSelecting an object of a NSArrayController Michael Varlik Jan 4, 20:32
mlRe: Selecting an object of a NSArrayController Hank Heijink Jan 4, 20:41
mlRe: Selecting an object of a NSArrayController William Turner Jan 4, 20:52
mlRe: Selecting an object of a NSArrayController Michael Varlik Jan 4, 21:04
mlRe: Selecting an object of a NSArrayController I. Savant Jan 4, 21:21
mlRe: Selecting an object of a NSArrayController Michael Varlik Jan 4, 22:18