Reputation: 1113
how could i make my Xcode application terminate completely when the user presses the X button.
Could you also provide some detail cause i'm sort of a beginner.
EDIT: Sorry for my vagueness, This is a desktop application.
Upvotes: 1
Views: 658
Reputation: 3294
Use - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender
method of AppDelegate. Sample:
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender
{
return YES;
}
Upvotes: 5