Re: Accessing NSArray objects with a key path
Re: Accessing NSArray objects with a key path
- Subject: Re: Accessing NSArray objects with a key path
- From: Steven Kramer <email@hidden>
- Date: Thu, 31 Mar 2005 13:50:09 +0200
Op 30-mrt-05 om 21:32 heeft email@hidden het volgende geschreven:
Hello,
I have an NSTableView that is being managed by an NSArrayController.
The
table columns all bind to different keys, like @"arrangedObjects.key1".
My problem is that I want @"arrangedObjects.key1" to return an NSArray
and
I want the table column to display only, say, the first object.
Something
to the effect of @"arrangedObjects.key1.objectAtIndex:0" or just
@"arrangedObjects.key1.0".
Is this kind of operation possible? Is there some array operator like
@max or @count that I am missing? I could write a custom formatter for
the column to pick off the part of the array I need but it seems like
there should be an easier way with the key paths. I have looked all
over
the documentation and old list threads but can't find any answers.
Thanks!
The easiest way will definitely a custom formatter. Other ways are
possible, but will be harder to get right. See the archives for a
recent thread on this issue.
Regards,
Steven Kramer
--
email@hidden
http://sprintteam.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden