Re: what about registering a transformer in the transformer?
Re: what about registering a transformer in the transformer?
- Subject: Re: what about registering a transformer in the transformer?
- From: Marc Respass <email@hidden>
- Date: Thu, 7 Dec 2006 12:40:20 -0500
Thanks (also to Keary) for the response. I do hate copying code so I
put all my transformers in a framework and wrote a class to register
them all. I'll put that registration line in the app delegate
(because they're all used).
Thanks again
Marc
On Dec 6, 2006, at 2:56 PM, R. Matthew Emerson wrote:
On Dec 6, 2006, at 2:17 PM, Marc Respass wrote:
So I always have to paste this code into +initialize of the class
that uses the transformer and I'm looking for a better way
Register all your value transformers in the +initialize method of
the application delegate object.
<http://developer.apple.com/documentation/Cocoa/Conceptual/
ValueTransformers/Concepts/Registration.html#//apple_ref/doc/uid/
20002166>
(which makes me wonder if I can register using a different name -
I always use the class name - but that's beside the point).
You can, e.g.,
t = [[LinearFormTransformer alloc] init];
[t setMultiplier:9.0/5.0];
[t setOffset:32];
[NSValueTransformer setValueTransformer:(NSValueTransformer *)t
forName:@"CelsiusToFahrenheit"];
[t release];
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden