My problem is that the NSApplicationWillTerminateNotification
is not called when I quit my applicat开发者_运维技巧ion. 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.
Apps in the background are terminated without any notification.
精彩评论