Re: applicationWillFinishLaunching vs. applicationDidFinishLaunching for NSDocument-based apps
Re: applicationWillFinishLaunching vs. applicationDidFinishLaunching for NSDocument-based apps
- Subject: Re: applicationWillFinishLaunching vs. applicationDidFinishLaunching for NSDocument-based apps
- From: Lee Ann Rucker <email@hidden>
- Date: Mon, 04 Aug 2014 21:06:43 +0000
- Thread-topic: applicationWillFinishLaunching vs. applicationDidFinishLaunching for NSDocument-based apps
On Aug 4, 2014, at 1:42 PM, Daryle Walker <email@hidden> wrote:
> A lot of sample code I see on web pages about application delegates use the applicationDidFinishLaunching: method for setting up any application-global data or routines. I just read a page about the Cocoa app initialization order, and it had the various NSDocument and NSDocumentController routines that create documents (blank, for opening, for printing, for non-visible processing) upon app-open occur before applicationDidFinishLaunching:. So I overrode applicationWillFinishLaunching: since my document subclass referenced a user-preference, needing me to initialize the user preferences before that. Do I got it right here?
>
> (If I’m right, this looks like a guide point for some Cocoa hint page.)
>
> Hmm, what kinds of code would have to be done in the “Did” version? The app code I’ve generally seen with a “Did” version could move it to a “Will” version.
“Did” is where I put things like “well, no documents were opened, so show the UI that’s appropriate for us since an untitled document isn’t what we want"
_______________________________________________
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