• 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: registering and use of bindings value transformers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: registering and use of bindings value transformers


  • Subject: Re: registering and use of bindings value transformers
  • From: Todd Ransom <email@hidden>
  • Date: Sat, 11 Mar 2006 09:05:22 -0700

Mike,

You want to perform the registration in your app delegate's + initialize method. Like this:

+ (void) initialize {
	static BOOL tooLate = NO;

    if ( !tooLate ) {

		NSNumberAsPercentageValueTransformer *numberAsPercentTransformer =
			[[[NSNumberAsPercentageValueTransformer alloc] init] autorelease];

		[NSValueTransformer setValueTransformer: numberAsPercentTransformer
			forName:@"numberAsPercentTransformer"];
	}
}

Todd Ransom
Return Self Software
http://returnself.com



On Mar 11, 2006, at 3:36 AM, Mike Abdullah wrote:

Can anybody help me get my head around how the registration process for custom value transformers is supposed to work? I've read the docs etc. but I'm still not entirely clear.

First, how many instances of my transformer should there be in the app. Say I have multiple document windows and each one has one interface element that uses the transformer, should I have an instance for each of the interface elements, or is there a single instance that all the elements share?

Of course, my real question, is when do I carry out this "registration"? The docs just say in the app's delegate, but I don't really get which delegate method I should be doing this in. I guess things also depend my above question.

Thanks,
Mike.
_______________________________________________
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

_______________________________________________ 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
  • Follow-Ups:
    • Re: registering and use of bindings value transformers
      • From: Dirk Stegemann <email@hidden>
References: 
 >registering and use of bindings value transformers (From: Mike Abdullah <email@hidden>)

  • Prev by Date: Re: Core Data Fetch Error - Followup
  • Next by Date: Popup List Contains <MyObject 0x1234>
  • Previous by thread: registering and use of bindings value transformers
  • Next by thread: Re: registering and use of bindings value transformers
  • Index(es):
    • Date
    • Thread