• 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: Bindings and Custom Array Operators
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bindings and Custom Array Operators


  • Subject: Re: Bindings and Custom Array Operators
  • From: Steven Kramer <email@hidden>
  • Date: Wed, 16 Mar 2005 09:29:52 +0100


Op 16-mrt-05 om 6:09 heeft E. Wing het volgende geschreven:

Hello, I would like to something kind of like the example at
http://homepage.mac.com/mmalc/CocoaExamples/ManualBindings.zip,
where there is a table of values and some field is computed based upon
all the values in the table.
However, in my case, I need to do some computations that are more
complex and are not expressed by the existing array operators provided
by Cocoa.

I was wondering if it is possible to define my own array operators.
Looking around, I don't see any hints of that, so in the case that it
is not possible, how would you recommend I approach this problem?

I would like to retain the live updating nature of the example, where
changing a value in the table can instantly recompute and redisplay
the value.


It can be done only in part and in an unsupported way. For instance, by defining a category on NSArray with a method '- (id) myOperator', you can use '@myOperator' for the keypath. You can't use 'deeper' keypaths, like '@myOperator.length' to have myOperator work on the 'length' properties of your items in the array. Not without overriding KVC methods, that is.



Regards,

Steven Kramer

--
email@hidden
http://sprintteam.com/

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Bindings and Custom Array Operators
      • From: mmalcolm crawford <email@hidden>
References: 
 >Bindings and Custom Array Operators (From: "E. Wing" <email@hidden>)

  • Prev by Date: Drag&Drop woes...
  • Next by Date: Re: Drag&Drop woes...
  • Previous by thread: Bindings and Custom Array Operators
  • Next by thread: Re: Bindings and Custom Array Operators
  • Index(es):
    • Date
    • Thread