Re: KVC with bindings to array elements?
Re: KVC with bindings to array elements?
- Subject: Re: KVC with bindings to array elements?
- From: Hank Heijink <email@hidden>
- Date: Fri, 20 Oct 2006 13:34:49 -0400
Cocoa is right - you can't convert an NSArray to an NSDictionary just
like that. Do you mean that you absolutely *have* to use an array? If
so, the dictionary idea isn't going to work.
What I meant was something like this: in your object, have an
instance variable like this:
NSDictionary *someDictionary;
The stuff that you want to bind your UI controls to would be in
there, so that
[someDictionary valueForKey:@"someKey"]
will give you the value you want to have in the control. Then you
bind the control to someDictionary.someKey, and that should do it.
Hank
On Oct 20, 2006, at 1:20 PM, Jeff Koftinoff wrote:
Thank you for your response; But I still have a problem. I can't
just have my accessor method return an NSDictionary - Cocoa expects
it to be an NSArray, and I get an exception saying it can't convert
the NSDictionary to the NSArray. I also tried implementing a
method named:
valueIn<Key>WithName
But it does not get called.
Jeff
On 20-Oct-06, at 8:09 AM, Hank Heijink wrote:
You might be better off with an NSDictionary for this. NSArray
doesn't support what you're trying to do.
On Oct 20, 2006, at 9:52 AM, Jeff Koftinoff wrote:
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.
_______________________________________________
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
Hank Heijink
www.hankheijink.com
email@hidden
_______________________________________________
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