I too have been wondering how others approach this issue. For a long time I
used "canRemove" and eventually switched to using my own value transformer
which does the heavy lifting for me. But it's quite tedious to include this
value transformer in every project I write which uses bindings like this, so
I've been looking for a "built-in" alternative. So now I'm wondering if
"selectedobjec...@count" is a good alternative. Have yet to try it, but it
looks viable.

-Steven

On Fri, Feb 19, 2010 at 8:27 AM, Ken Thomases <[email protected]> wrote:

> On Feb 19, 2010, at 7:15 AM, Jerry Krinock wrote:
>
> > On 2010 Feb 19, at 03:02, Jean-Denis Muys wrote:
> >
> >> I have tried bindings to selectedObjects using the model key "count", as
> a non zero count is obviously compatible with the BOOL that the property
> expects. But this doesn't work: I get an error message:
> >>
> >> "Cannot create BOOL from object () of class __NSArray0"
> >
> > It means that it wants a BOOL but the selectedObjects you're giving it is
> an array.
>
> Did you try the @count KVC operator?
>
> http://developer.apple.com/mac/library/documentation/cocoa/conceptual/KeyValueCoding/Concepts/ArrayOperators.html
>
> Using the model key "count" to an array property (selectedObjects) builds a
> new array containing the results of invoking valueForKey:@"count" to each
> element of selectedObjects, which isn't what you meant.
>
> Regards,
> Ken
>
> _______________________________________________
>
> Cocoa-dev mailing list ([email protected])
>
> 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/steven.degutis%40gmail.com
>
> This email sent to [email protected]
>



-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.org/
_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to