• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: what is a bindings pattern to check for a non-empty selection?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: what is a bindings pattern to check for a non-empty selection?
      • From: Steven Degutis <email@hidden>
References: 
 >what is a bindings pattern to check for a non-empty selection? (From: Jean-Denis Muys <email@hidden>)
 >Re: what is a bindings pattern to check for a non-empty selection? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: what is a bindings pattern to check for a non-empty selection?
  • Next by Date: Re: what is a bindings pattern to check for a non-empty selection?
  • Previous by thread: Re: what is a bindings pattern to check for a non-empty selection?
  • Next by thread: Re: what is a bindings pattern to check for a non-empty selection?
  • Index(es):
    • Date
    • Thread