Re: what is a bindings pattern to check for a non-empty selection?
Re: what is a bindings pattern to check for a non-empty selection?
- Subject: Re: what is a bindings pattern to check for a non-empty selection?
- From: Ken Thomases <email@hidden>
- Date: Fri, 19 Feb 2010 07:27:39 -0600
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@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