Re: Cannot get toolbar to appear in window
Re: Cannot get toolbar to appear in window
- Subject: Re: Cannot get toolbar to appear in window
- From: <email@hidden>
- Date: Thu, 26 Apr 2007 19:41:11 +0100
Hi All,
Thanks for the feedback so far. As Murat has mentioned surely delegate method calls are made on the main thread and so
will be synchronous. The Cocoa docs state:
for awakeFromNib: "An awakeFromNib message is sent to each object loaded from the archive, but only if it can respond to
the message, and only after all the objects in the archive have been loaded and initialized"
for applicationDidFinishLaunching: "Sent by the default notification center after the application has been launched and
initialized but before it has received its first event."
So I don't think it would be a race condition due to the nib and its contents not being properly loaded and initialized as they
are guaranteed to be loaded and initialized before awakeFromNib is called. awakeFromNib is sent to all objects in the nib
but I doin't think that is a problem here?
So still not sure why it is failing.
Thanks,
Timothy Mowlem
> The OP is calling his toolbar setup code from his app delegate's awakeFromNib method. By definition, all objects in the
nib should already exist and outlets be set when awakeFromNib gets called. You shouldn't have to resort > to delayed calls
to solve this problem.
>
> _murat
>> On Apr 25, 2007, at 3:10 PM, John Stiles wrote:
>>
>> I'd expect that the event loop wouldn't get a chance to invoke his delayed call until after all the nibs finished loading
anyway. He can probably delay for 0.0 seconds and it would work too.
>>
>> On Apr 25, 2007, at 2:12 PM, Michael Watson wrote:
>>
>> And what if it takes 0.2 seconds to finish creating other nib objects?
>>
>> He should use an IBOutlet, probably.
>>
>>
>> --
>> m-s
>>> On 25 Apr, 2007, at 16:54, Steve Israelson wrote:
>>>
>>> Is [NSApp mainWindow] returning nil maybe?
>>> You may have to delay the execution of your toolbar create for about 0.1 seconds to allow the OTHER NIb file objects
to be created first?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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