Re: Very Simple Demo: Modal Dialog causes later Modal Session to Crash
Re: Very Simple Demo: Modal Dialog causes later Modal Session to Crash
- Subject: Re: Very Simple Demo: Modal Dialog causes later Modal Session to Crash
- From: Lee Ann Rucker <email@hidden>
- Date: Wed, 15 Sep 2010 19:49:13 -0700
- Acceptlanguage: en-US
- Thread-topic: Very Simple Demo: Modal Dialog causes later Modal Session to Crash
On Sep 15, 2010, at 7:30 PM, Kyle Sluder wrote:
> On Wed, Sep 15, 2010 at 7:11 PM, Jerry Krinock <email@hidden> wrote:
>> Anything that I want to happen before a document opens, in case the app is launched by doubleclicking a document.
>
> I think the right pattern to use here would be to set a flag in
> -applicationDidFinishLaunching: or some later point. Until that flag
> is set, return NO from -applicationShouldOpenUntitledFile:.
But for catching the case where your app is launched by a double-click, what you want is application:openFile: or application:openFiles:
>From the doc:
If the user started up the application by double-clicking a file, the delegate receives the application:openFile: message before receiving applicationDidFinishLaunching:. (applicationWillFinishLaunching: is sent before application:openFile:.)
If that method returns NO, the application will attempt to open it with openDocumentWithContentsOfURL. Return YES and it assumes you've dealt with it. The runloop is live at this point, because our app shows some UI at that point.
>
> @end
>
>> Is it correct to say that one should not do "GUI Things" or "AppKit Stuff" in -applicationWillFinishLaunching: ?
>
> I would say that is a safe rule to live by.
>
> --Kyle Sluder
> _______________________________________________
>
> 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
_______________________________________________
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