• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: what about registering a transformer in the transformer?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >what about registering a transformer in the transformer? (From: Marc Respass <email@hidden>)
 >Re: what about registering a transformer in the transformer? (From: "R. Matthew Emerson" <email@hidden>)

  • Prev by Date: Re: Displaying 2 images in a single cell of nstableview
  • Next by Date: Re: WebKit if-modified
  • Previous by thread: Re: what about registering a transformer in the transformer?
  • Next by thread: Re: what about registering a transformer in the transformer?
  • Index(es):
    • Date
    • Thread