Re: Uninitialized rectangle??
Re: Uninitialized rectangle??
- Subject: Re: Uninitialized rectangle??
- From: fabian <email@hidden>
- Date: Thu, 4 Mar 2010 09:42:51 +0100
On Thu, Mar 4, 2010 at 12:38 AM, Jens Alfke <email@hidden> wrote:
>
> 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.
Right. But why should it matter? The system status bar is not in the nib.
Just curious about what is going on behind the scenes...
> 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
It's a modal, indeed. I can see why it's a bad thing in theory, but I
haven't had any problems with this approach. It's there to make sure the
welcome dialog is displayed before Sparkle (pre 1.5) asks how the user wants
to check for updates.
Anyway, back to subject. Perhaps a better approach than using timers,
guesswork and voodoo, would be to check the validity of the frame rect and,
if it's zero or garbage, make my own rectangle. How can I do this (validate
rect & get the preferred height of the status bar)?
F.
_______________________________________________
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