• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Defer opening documents until app is fully inited
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Defer opening documents until app is fully inited


  • Subject: Re: Defer opening documents until app is fully inited
  • From: Jerry Krinock <email@hidden>
  • Date: Sat, 20 Sep 2014 06:51:32 -0700



On 2014 Sep 19, at 09:12, Mills, Steve <email@hidden> wrote:

> Our app init (called from applicationWillFinishLaunching) needs to put up some modal dialogs.

I’m surprised that works.  I think I was in a similar situation about 4 years ago.

http://www.cocoabuilder.com/archive/cocoa/293279-very-simple-demo-modal-dialog-causes-later-modal-session-to-crash.html?q=applicationWillFinishLaunching+Krinock#293279

Or if Bertrand’s site ever goes away,

http://lists.apple.com/archives/Cocoa-dev/2010/Sep/msg00448.html

> When one of these modals is dismissed, NSApplication proceeds to call application:openFiles:, but we haven't returned from applicationWillFinishLaunching yet, so we're not ready. I'm sure others have needed to work around this. What's the best way?

To summarize, what worked for me is to

• Create my dialogs or whatever in an doEarlyChores method.
• Override -application:openFile: to invoke the doEarlyChores method and return NO.
• Also invoke the doEarlyChores method early in -applicationDidFinishLaunching.
• Put a lockout in doEarlyChores so it will only do its chores once.


On 2014 Sep 19, at 10:42, Mills, Steve <email@hidden> wrote:

> And we're too late in the cycle now to make such a radical change.

Life is hard, Steve.  That reminds of what a wise manager told our team at times of crisis: “There’s never enough time to do it right [the first time], but there will be always enough time to do it over [when the product fails in the field].” :))


_______________________________________________

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


  • Follow-Ups:
    • Re: Defer opening documents until app is fully inited
      • From: "Mills, Steve" <email@hidden>
References: 
 >Defer opening documents until app is fully inited (From: "Mills, Steve" <email@hidden>)
 >Re: Defer opening documents until app is fully inited (From: edward taffel <email@hidden>)
 >Re: Defer opening documents until app is fully inited (From: "Mills, Steve" <email@hidden>)

  • Prev by Date: Re: MapKit location authorization
  • Next by Date: Re: return string that is the difference between two other strings
  • Previous by thread: Re: Defer opening documents until app is fully inited
  • Next by thread: Re: Defer opening documents until app is fully inited
  • Index(es):
    • Date
    • Thread