• 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: Value transformers and app delegates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Value transformers and app delegates
      • From: James Dessart <email@hidden>
References: 
 >Value transformers and app delegates (From: James Dessart <email@hidden>)

  • Prev by Date: Value transformers and app delegates
  • Next by Date: iCal RRULE
  • Previous by thread: Value transformers and app delegates
  • Next by thread: Re: Value transformers and app delegates
  • Index(es):
    • Date
    • Thread