Re: NSDictionary and binding
Re: NSDictionary and binding
- Subject: Re: NSDictionary and binding
- From: Greg Hurrell <email@hidden>
- Date: Thu, 28 Oct 2004 03:25:37 +0200
El 28/10/2004, a las 2:05, mmalcolm crawford escribió:
It *sounds* like you're expecting things to work backwards from the
way they do.
Probably due to my confusion. I've done a *lot* of reading on this but
can't make much sense of it. It is definitely the hardest Cocoa topic
I've yet come across since I started two years ago. My brain just
doesn't seem to want to assimilate it!
See the "Joystick" view from the Graphics Bindings example at
<http://homepage.mac.com/mmalc/CocoaExamples/controllers.html>.
Thanks. Funny you should say that. I had downloaded it and was looking
at it when your reply came in. I will study it some more and reply once
I've got it all figured out.
It might be appropriate to write a value transformer to convert
to/from a dictionary from/to your custom class.
Just a quick question on NSValueTransformers... Reading this doc here,
"Writing a Custom Value Transformer",
<file:///Developer/ADC Reference Library/documentation/Cocoa/
Conceptual/ValueTransformers/Concepts/CustomTransformer.html>, I note
that it says: "A value transformer subclass must implement the
transformedValueClass class method. This returns the class of the
object that both the transformedValue: and reverseTransformedValue:
methods will return." This is a little confusing for me because it
indicates that I can, for example, transform from an NSNumber to an
NSNumber, or an NSString to an NSString, but not my ComplexObject class
to NSDictionary...
Perhaps I am reading the docs wrong, but from what you say (and you
seem to know a lot about Cocoa Bindings) you can indeed have a
transformer that moves back and forth between two different types of
class... so which class, then, do I return in my -transformedValueClass
method? The NSDictionary class, or the ComplexObject class? (Or is this
once again a case of my brain not assimilating a new Cocoa concept?)
Cheers,
Greg
_______________________________________________
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