Re: Reverse value transformation with different class?
Re: Reverse value transformation with different class?
- Subject: Re: Reverse value transformation with different class?
- From: Wain <email@hidden>
- Date: Wed, 23 Nov 2005 17:49:34 +0000
On 23 Nov 2005, at 17:20, Tom Harrington wrote:
I need to implement a value transformer that will convert a string
representation of a color into an NSColor and back, for purposes of
bindings.
This is possible, look at:
http://developer.apple.com/documentation/Cocoa/Conceptual/
ValueTransformers/index.html
Specifically the “Writing a Custom Value Transformer” section.
I would suggest however that you simply convert the NSColor to NSData
and back, it's much easier...
The documentation on writing a custom value transformer says that +
transformedValueClass must return "the class of the object that both
the transformedValue: and reverseTransformedValue: methods will
return."
The documentation actually states: "Returns the class of the value
returned by the transformer. Subclasses should override this method
and return the appropriate class."
The whole point is to transform from one type to another. :-)
Wain
___________________________________________________________
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.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