• 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
applicationShouldTerminateAfterLastWindowClosed bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

applicationShouldTerminateAfterLastWindowClosed bug?


  • Subject: applicationShouldTerminateAfterLastWindowClosed bug?
  • From: m <email@hidden>
  • Date: Tue, 13 Jul 2004 22:57:18 -0700

I think I've found a surprising bug related to NSApplication's applicationShouldTerminateAfterLastWindowClosed delegate method. I would appreciate if anyone else could verify it or explain why it's not a bug. This is in Mac OS X 10.3.4

The bug is that if your app has a delegate, and the delegate implements
applicationShouldTerminateAfterLastWindowClosed to return YES, bringing up the about box causes the app to quit.

To reproduce:

1) make a Cocoa App project (non-document based)
2) add an application delegate like this one (don't forget to hook it up in Interface Builder)

/* AppDelegate.h */

#import <Cocoa/Cocoa.h>

@interface AppDelegate : NSObject
{
}
@end

--------------------------
/* AppDelegate.m */

#import "AppDelegate.h"

@implementation AppDelegate

- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication
{
return YES;
}
@end

3) build and launch the app
4) open the about box

Result: Poof! The app quits.

_murat
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: applicationShouldTerminateAfterLastWindowClosed bug?
      • From: Hasan Diwan <email@hidden>
  • Prev by Date: RE: Makefile
  • Next by Date: Re: AppleScript create command
  • Previous by thread: Re: Window "Flash"
  • Next by thread: Re: applicationShouldTerminateAfterLastWindowClosed bug?
  • Index(es):
    • Date
    • Thread