On Sep 15, 2010, at 7:30 PM, Kyle Sluder wrote:

> On Wed, Sep 15, 2010 at 7:11 PM, Jerry Krinock <je...@ieee.org> 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 (Cocoa-dev@lists.apple.com)
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/lrucker%40vmware.com
> 
> This email sent to lruc...@vmware.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to