• 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: Very Simple Demo: Modal Dialog causes later Modal Session to Crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Kyle Sluder <email@hidden>
  • Date: Wed, 15 Sep 2010 19:30:34 -0700

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:.

@interface MyAppDelegate : NSObject <NSApplicationDelegate> {
  BOOL _shouldOpenUntitled;
}

@end

@implementation MyAppDelegate

- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)myApp; {
  return _shouldOpenUntitled;
}

- (void)applicationDidFinishLaunching:(NSNotification *)aNote; {
  if (DoStuffBeforeFirstDocument() == YES) {
    _shouldOpenUntitled = YES;
    [[NSDocumentController sharedDocumentController] newDocument:nil];
  }
}

@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

  • Follow-Ups:
    • Re: Very Simple Demo: Modal Dialog causes later Modal Session to Crash
      • From: Lee Ann Rucker <email@hidden>
References: 
 >Very Simple Demo: Modal Dialog causes later Modal Session to Crash (From: Jerry Krinock <email@hidden>)
 >Re: Very Simple Demo: Modal Dialog causes later Modal Session to Crash (From: Kyle Sluder <email@hidden>)
 >Re: Very Simple Demo: Modal Dialog causes later Modal Session to Crash (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: keyDown:theEvent
  • Next by Date: Re: Very Simple Demo: Modal Dialog causes later Modal Session to Crash
  • Previous by thread: Re: Very Simple Demo: Modal Dialog causes later Modal Session to Crash
  • Next by thread: Re: Very Simple Demo: Modal Dialog causes later Modal Session to Crash
  • Index(es):
    • Date
    • Thread