• 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: Array operators (was: Custom canRemove binding)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Custom canRemove binding (From: ian <email@hidden>)
 >Re: Custom canRemove binding (From: Allan Odgaard <email@hidden>)
 >Re: Custom canRemove binding (From: ian <email@hidden>)
 >Re: Custom canRemove binding (From: Scott Anguish <email@hidden>)
 >Array operators (was: Custom canRemove binding) (From: Allan Odgaard <email@hidden>)
 >Re: Array operators (was: Custom canRemove binding) (From: Scott Anguish <email@hidden>)

  • Prev by Date: URL and Proxy
  • Next by Date: Re: Adding Document Types Programmatically
  • Previous by thread: Re: Array operators (was: Custom canRemove binding)
  • Next by thread: Re: Array operators (was: Custom canRemove binding)
  • Index(es):
    • Date
    • Thread