Re: Array operators (was: Custom canRemove binding)
Re: Array operators (was: Custom canRemove binding)
- Subject: Re: Array operators (was: Custom canRemove binding)
- From: Allan Odgaard <email@hidden>
- Date: Thu, 6 May 2004 10:31:04 +0200
On 6. May 2004, at 3:21, Scott Anguish wrote:
[...] bind enabled2 to theArrayController.content.count
Which should probably be: theArrayController.arrangedObjects.@count
you're right about the arrangedObjects..
But not '@count'? Using "count" will result in valueForKey:@"count"
sent to the array, which will *not* find the count method, since the
array overloads valueForKey: so that it is sent to every element in the
array, and a new array containing the results is returned.
[...]
@count isn't a legitimate keypath I don't think.
From:
http://developer.apple.com/documentation/Cocoa/Conceptual/
KeyValueCoding/Concepts/ArrayOperators.html
Array operators allow you to specify operations to be
performed on an arrays items using a key path of the
form email@hiddenthToProperty. This
article describes the available array operators.
[...]
The @count operator returns the number of objects, as
an NSNumber, in the collection specified by the key
path. [...]
[savingsAccount valueForKeyPath:@transactions.@count]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.