FROM : Kevin Dixon
DATE : Tue Mar 11 20:07:03 2008
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"
> <felipemonteiro.<email_removed>>
> Subject: Quit application when window closes
> To: "Cocoa-dev list" <<email_removed>>
> Message-ID:
> <<email_removed>>
> 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
DATE : Tue Mar 11 20:07:03 2008
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"
> <felipemonteiro.<email_removed>>
> Subject: Quit application when window closes
> To: "Cocoa-dev list" <<email_removed>>
> Message-ID:
> <<email_removed>>
> 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
| Related mails | Author | Date |
|---|---|---|
| Felipe Monteiro de… | Mar 11, 11:22 | |
| Ron Fleckner | Mar 11, 11:44 | |
| Kevin Dixon | Mar 11, 20:07 | |
| Felipe Monteiro de… | Mar 12, 00:51 | |
| Joachim Deelen | Mar 12, 16:40 | |
| Kyle Sluder | Mar 12, 21:48 |






Cocoa mail archive

