• 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 18:58:20 -0700

On Wed, Sep 15, 2010 at 6:07 PM, Jerry Krinock <email@hidden> wrote:
> - (void)applicationWillFinishLaunching:(NSNotification*)aNotification {
>    NSRunAlertPanel(@"Hello",
>                    @"A crash is coming soon.",
>                    @"OK",
>                    nil,
>                    nil) ;
> }

There's no runloop running yet when -applicationWillFinishLaunching:
is called. You can see this for yourself by installing a
CFRunLoopObserver in main(), before calling NSApplicationMain. As
such, this is a very sensitive point in the app's life cycle. Among
other things, AppKit's automatically-installed autorelease pool hasn't
been installed yet (which you can verify by putting a call to the
undocumented NSPopAutoreleasePool function in
-applicationWillFinishLaunching:). That's why you're getting all the
autorelease pool warnings on the console.

Then NSRunAlertPanel is going to run the app in a modal mode before
the app has finished setting itself up. I'm not surprised that doesn't
work.

What is there that you can't do in -applicationDidFinishLaunching:?

--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: Jerry Krinock <email@hidden>
References: 
 >Very Simple Demo: Modal Dialog causes later Modal Session to Crash (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Very Simple Demo: Modal Dialog causes later Modal Session to Crash
  • Next by Date: keyDown:theEvent
  • Previous by thread: 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