Hazards during applicationWillFinishLaunching?
Hazards during applicationWillFinishLaunching?
- Subject: Hazards during applicationWillFinishLaunching?
- From: Eric Roccasecca <email@hidden>
- Date: Thu, 1 Nov 2001 16:21:56 -0600
Are there any restrictions on what can and cannot be done during
applicationWillFinishLaunching? Apple's docs say
applicationWillFinishLaunching is "sent by the default notification
center immediately before the NSApplication object is initialized."
That makes me think it would not be safe to call any
-[NSApplication ...] methods during applicationWillFinishLaunching?
The reason I ask this is that the app I am working on actually calls
NSApp methods during applicationWillFinishLaunching and works just fine
except if the app is set as a login app (in the Login pane in system
prefs) at system startup (not just a logout/login cycle). On startup
(restart or cold boot) we start getting NSPortTimeoutExceptions and they
seem to always involve some direct or indirect call to NSApp methods
during applicationWillFinishLaunching. But even better it only happens
on some machines (especially sub 500MHz G4s)! Odd I say!
So I changed our code to use applicationDidFinishLaunching and the
problem appears to be better (our QA lab is testing as I write this) but
does anyone have any idea why this would be happening only at startup?
Just double clicking our app in the Finder works perfectly.
Lastly is applicationDidFinishLaunching/applicationWillFinishLaunching a
good place to finish initializing our app? Is there a better place?
Note I have cross posted this to email@hidden and
email@hidden.
--Eric
Eric Roccasecca
email@hidden
Software Engineer
CE Software, Inc.
www.cesoft.com
P 515-221-1801
F 515-221-1806