KVC with bindings to array elements?
KVC with bindings to array elements?
- Subject: KVC with bindings to array elements?
- From: Jeff Koftinoff <email@hidden>
- Date: Fri, 20 Oct 2006 06:52:12 -0700
Hi everyone; I'm fairly new to KVC. I have my application working
fabulously with my data model. Parameters and sliders and text
field's values, min, and max are bound to my objective c object.
Parameter validation works great.
However now I want to make an static array of values - each element
bound to a different gui control.
What key path do I use to specify the n'th NSNumber in a
NSMutableArray? I tried the following:
myData.params.2
myData.params.@2
myData.params@2
And then what is the best way to implement the methods in my object
to allow for this?
Or do I have to split them all out of the array and have separate
methods for each item like:
- (void) setParams0: (NSNumber *);
- (void) setParams1 : (NSNumber *);
- (void) setParams2 : (NSNumber *);
- (NSNumber *) getParams0;
- (NSNumber *) getParams1;
- (NSNumber *) getParams2;
etc...? I can't imagine I must resort to this..
All the examples I find for KVC and arrays are assuming that the
array is something to be filled in by the user with dynamic number of
items, for table views etc.
Regards,
Jeff Koftinoff
_______________________________________________
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