On Feb 6, 2015, at 01:56:24, Quincey Morris 
<quinceymor...@rivergatesoftware.com> wrote:

> You can’t bind *through* an array or set collection class. However, you can 
> use these:
> 
>       
> https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/KeyValueCoding/Articles/CollectionOperators.html
> 

On Feb 6, 2015, at 02:03:34, Ken Thomases <k...@codeweavers.com> wrote:

> You can't use KVO or bindings through arrays or sets, even to their immediate 
> properties.
> 
> For KVC, if you were to attempt to do [theTableCellView 
> valueForKeyPath:@"objectValue.images.count"], that would attempt to get the 
> "count" property of each _element_ of objectValue.images and return a set 
> containing all of those counts (wrapped in NSNumbers).  In theory, if KVO 
> through sets worked, then observing the key path objectValue.images.count 
> would not notify you when the count of objectValue.images changed.  It would 
> notify you when the set returned by [theTableCellView 
> valueForKeyPath:@"objectValue.images.count"] changed (or might have changed). 
>  That's not what you want, anyway.
> 
> However, there are collection operators 
> <https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/KeyValueCoding/Articles/CollectionOperators.html>,
>  including @count.  You can bind to that with model key path 
> objectValue.images.@count.

Weeeellll doggies! Just when I was about to go to bed, you guys come through 
with the goods and make my night. :) Thanks so much. I need to read the KVC and 
KVO articles again.

--
Steve Mills
Drummer, Mac geek


_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to