Can keypaths contain array indexes?
Can keypaths contain array indexes?
- Subject: Can keypaths contain array indexes?
- From: Jens Alfke <email@hidden>
- Date: Thu, 21 Jul 2011 12:08:34 -0700
I’ve got a data model that looks sort of like this (expressed as JSON):
[{“uuid": “abcdef”, “name": [“Fred”, “Smith”]} … ]
I want to bind an array of these to an NSTableView, with the first and last name in different columns. So I need to create a keypath that refers to the first or second element of the array value of the “name” property.
Is this possible? I’ve looked through the docs and can’t find anything about it. I’ve guessed at paths like
name.0
or
name[0]
but they throw exceptions at runtime.
(And no, I can’t change the schema to avoid having an array. It’s part of the way the data comes back from the server.)
—Jens_______________________________________________
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