On Aug 16, 2011, at 13:02 , Kyle Sluder wrote:

> Either way, I believe you're correct, and there's no way to get at
> individual indexed members of an ordered collection via
> -valueForKeyPath:.

In the Land of Speculation …

I think it's in principle possible to have such a mechanism, though of course I 
haven't tried it.

Noting that a key path like "someObject.someArrayProperty.count" is valid, I 
think you could envisage key paths of the form 
"someObject.someArrayProperty.@0" and @1, @2, @3, etc. For this to work, 
"someObject.someArrayProperty" would have to return a NSArray subclass (or a 
compatible proxy object) that implements 'valueForUndefinedKey:' and recognizes 
the "indexing" properties from their key name syntax.

Such an implementation would be useful only in limited situations. Something 
has to generate the correct key syntax from the desired index value. (Those 
weird IB "patterns" might be useful for some cases.) KVO compliance might be 
infeasible, too.

But strictly from a KVC perspective, I believe the problem is formally solvable.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to