2007/10/24, Mike Schrag <email@hidden>:
Because NSArray has a custom implementation of valueForKey that tries
to call whatever key you give it on the elements of the array ... For
instance, "array.name" returns an array of the names of all the
elements in the array. The only exceptions to this are @ operators
and "count". What you want is WOConditional condition =
downloads.count (negate = false).
I've notice one thing with NSDictionary:
you can call directly the key of the element to get the value:
dict = {key1 = "MyValue1", key2 = "MyValue2"}
str : WOString {
value = dict.key1;
}
and result is MyValue1.
is this how dictionaries work?
ms
On Oct 24, 2007, at 9:19 AM, Miguel Arroz wrote:
> Hi!
>
> Sometimes I really think I should change business!
>
> I have this binding:
>
> ShowDowndloadsConditional: WOConditional {
> condition = downloads.isEmpty
;
> negate = true;
> }
>
> "downloads" is an NSArray.
>
> When running, I get this:
>
> Reason:
> <my.top.secret.package.name.ExportDownloadItem
0xb95569> valueForKey
> (): lookup of unknown key: 'isEmpty'. This class does not have an
> instance variable of the name isEmpty or _isEmpty, nor a method of
> the name isEmpty, _isEmpty, getIsEmpty, or _getIsEmpty
>
> The ExportDownloadItem is an object in the array.
>
> My question is... why!?!?!? :)
>
> If I do this the dull way (write a method that returns
> downloads.isEmpty() ) and bind to it, this works.
>
> Yours
>
> Miguel Arroz
>
> Miguel Arroz
> http://www.terminalapp.net
> http://www.ipragma.com
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (
email@hidden)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/mschrag%
> 40mdimension.com
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/email@hidden
This email sent to
email@hidden