Silicone
Silicone

Reputation: 673

NSApplicationWillTerminateNotification not Working

My problem is that the NSApplicationWillTerminateNotification is not called when I quit my application. What I have tried: (appDelegate.m)

- (void) applicationDidFinishLaunching:(NSNotification *)aNotification{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillTerminate:) name:NSApplicationWillTerminateNotification object:nil];
}

- (void)applicationWillTerminate:(NSNotification *)aNotification{
NSLog(@"quit");
}

OR

- (void)applicationWillTerminate:(NSApplication *)application{
NSLog(@"Quit");
}

My application has no window, as it is a background application -> I deleted the window and the menu in interface Builder.

Upvotes: 0

Views: 439

Answers (1)

progrmr
progrmr

Reputation: 77193

Apps in the background are terminated without any notification.

Upvotes: 1

Related Questions