On 11 Nov 2009, at 21:23, kirankumar wrote:
> this will help you
> keep this 3lines of code in awakeFromNib, and mpwindow is you are window name.
> 
> id closeButton = [mpWindow standardWindowButton:NSWindowCloseButton ];
> [closeButton setAction:@selector(closeapp:)];
> [closeButton setTarget:self];

No, don't do that. See -[NSApplication 
applicationShouldTerminateAfterLastWindowClosed:] for the correct approach.

> - (IBAction)closeapp:(id)sender
> {
> exit(0);
> }

I'm pretty sure that this will end up skipping most cleanup routines (including 
important ones, like syncing dirty preferences). NSApplication has a terminate: 
method for a reason._______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to