Re: app delegate +initialize
Re: app delegate +initialize
- Subject: Re: app delegate +initialize
- From: Bill Bumgarner <email@hidden>
- Date: Tue, 22 Sep 2009 23:21:05 -0700
On Sep 22, 2009, at 10:50 PM, John Baldwin wrote:
I'm missing something in the loading of an application delegate.
In my MainMenu.xib file, the File's Owner delegate connection is set
to an AppController object. File's Owner's class is set to
NSApplication.
In the AppController class, a +(void)initialize method is defined.
The +(void)initialize method gets called and my initialization
happens as expected on my development machine. Every time, it seems.
But on a second test machine, the method doesn't get called. Ever,
it seems.
Both machines are running 10.5.8.
I can't figure out what I'm missing to get the AppController class
loaded and initialized as planned. Could anyone point me in the
right direction?
First, that seems odd. Feel free to file a bug via http://bugreport.apple.com/
and attach a copy of the binary of your application.
On the second machine, have you verified that the nib is loaded
correctly and, more importantly, that the AppController class is
instantiated?
In any case, +initialize shouldn't be used for anything but the most
basic of initialization; setting up a global or two or the like. On
application launch, there are much better -- much more controlled --
hooks for doing initialization work. Not having seen your code, it
may be doing only very basic things -- great -- just a comment for
completeness.
b.bum
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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