Re: Quit application when window closes
Re: Quit application when window closes
- Subject: Re: Quit application when window closes
- From: "Kevin Dixon" <email@hidden>
- Date: Tue, 11 Mar 2008 15:07:03 -0400 (EDT)
- Importance: Normal
Your window controller will need the method
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication
*)inSender
{
return YES;
}
and then you need to specify the window controller as the delegate for the
application
[NSApp setDelegate:self];
I do that in awakeFromNib, but you may have to find a different solution,
since you're not using Nib files. Hope that helps,
-Kevin
>
> Message: 12
> Date: Tue, 11 Mar 2008 07:22:17 -0300
> From: "Felipe Monteiro de Carvalho"
> <email@hidden>
> Subject: Quit application when window closes
> To: "Cocoa-dev list" <email@hidden>
> Message-ID:
> <email@hidden>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hello,
>
> How can I implement the behavior that the application closes when my
> window closes?
>
> The application contains no nib files and doesn't use the interface
> builder, it's every thing done by code.
>
> thanks,
> --
> Felipe Monteiro de Carvalho
_______________________________________________
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