Re: Value transformers and app delegates
Re: Value transformers and app delegates
- Subject: Re: Value transformers and app delegates
- From: Brendan Younger <email@hidden>
- Date: Tue, 21 Dec 2004 09:33:56 -0600
On Dec 21, 2004, at 9:28 AM, James Dessart wrote:
Using information from Apple's docs on value transformers, and a
helpful post from Scott Anguish, to someone else, from August, I
implemented an "array has contents" value transformer. I then register
it in applicationDidFinishLaunching.
However, it seems that it doesn't get registered before the nib gets
loaded, causing the app to bail. I've put an NSLog in both
applicationWillFinishLaunching and applicationDidFinishLaunching, and
neither seems to get called. I have the class instantiated and set as
the delegate in the nib, is there perhaps an ordering problem going
on?
That's correct. NSApp will load your nib before
-(void)applicationDid/WillFinishLaunching is ever called. To be
absolutely sure that your transformer is registered, you can call
[NSValueTransformer setValueTransformer:forName:] in your main()
function, before the call to NSApplicationMain(), or you can override
+(void)initialize in your application's delegate and register it there.
Brendan Younger
_______________________________________________
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