0

How do I bind all corresponding elements of several arrays?

Wendt's book Cocoa shows an example binding a property, a slider, and a textfield in IB. Change any one and the other two track its value. It's very simple. Wendt strongly makes the point that controllers are not necessary in simple cases.

I would like to extend this to binding an array of properties, an array of sliders, and an array of textfields. Change the 3rd slider, for example, and the 3rd property and 3rd textfield should change accordingly.

But would an NSArrayController be of any benefit in this case? I plead ignorance because all the examples I've found show NSArrayController used only with NSTable.

j yrez
  • 243
  • 1
  • 3
  • 11
  • have you considered [KVO](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/KeyValueCoding/Articles/KeyValueCoding.html)? – abbood Sep 27 '13 at 04:47
  • daim.. i was looking at this [bindings documentation](https://developer.apple.com/library/mac/documentation/cocoa/Conceptual/CocoaBindings/CocoaBindings.html#//apple_ref/doc/uid/10000167i).. looked very interesting.. unfortunately.. it [seems](https://developer.apple.com/library/ios/documentation/miscellaneous/conceptual/iphoneostechoverview/PortingfromCocoa/PortingfromCocoa.html) like it's not supported in iOS right? – abbood Sep 27 '13 at 04:55
  • right.. http://stackoverflow.com/questions/1811242/what-is-the-cocoa-touch-equivalent-to-nsarraycontroller – abbood Sep 27 '13 at 04:57
  • abbood - yes. this is exactly what I'm trying to do, but lack the ability to do it in detail. – j yrez Sep 28 '13 at 06:28

0 Answers0