Re: Uninitialized rectangle??
Re: Uninitialized rectangle??
- Subject: Re: Uninitialized rectangle??
- From: Jens Alfke <email@hidden>
- Date: Wed, 3 Mar 2010 15:38:51 -0800
On Mar 3, 2010, at 3:00 PM, fabian wrote:
Thanks for your replies. I understand that the -frame message is
returning
garbage. What I don't understand is why statusBar, statusItem or the
statusItem's view is nil during (but not after) the unarchiving of
the nib,
or (on 10.5.8) even shortly after NSApp is fully loaded. Or is it?
By the time -applicationDidFinishLaunching is called, everything
should be up and running. During -awakeFromNib (of the main nib),
things are iffier. You know that your outlets have been initialized,
but you don't know that every other object's -awakeFromNib method has
run yet.
It's definitely related to the app/nib not being up and ready to go.
I'm displaying a dialog on first run in awakeFromNib. When the dialog
Putting up a dialog from within an -awakeFromNib method is a really,
really, bad idea. (If it's a modal dialog, add three or four more
"really"s.) You should either do the check later, or a delayed-perform
so the dialog is only displayed after the app is initialized.
—Jens_______________________________________________
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