Re: registering and use of bindings value transformers
Re: registering and use of bindings value transformers
- Subject: Re: registering and use of bindings value transformers
- From: Dirk Stegemann <email@hidden>
- Date: Sat, 11 Mar 2006 18:34:38 +0200
Hi,
Am 11.03.2006 um 18:05 schrieb Todd Ransom:
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"];
}
}
Isn't there a 'tooLate = YES;' inside the 'if ( !tooLate ) { [...] }'
part missing?
Regards,
Dirk Stegemann
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:
email@hidden
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