applicationShouldTerminateAfterLastWindowClosed bug?
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.