Re: applicationShouldTerminateAfterLastWindowClosed bug?
Re: applicationShouldTerminateAfterLastWindowClosed bug?
- Subject: Re: applicationShouldTerminateAfterLastWindowClosed bug?
- From: Hasan Diwan <email@hidden>
- Date: Wed, 14 Jul 2004 12:04:42 -0700
Murat:
Does your app show the main window or is it closed for the about
panel? If closed, then it's expected behaviour, if not, file a bug.
On Tue, 13 Jul 2004 22:57:18 -0700, m <email@hidden> wrote:
>
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.
>
>
--
Cheers,
Hasan Diwan <email@hidden>
_______________________________________________
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.