Mil0R3
Mil0R3

Reputation: 3956

NSView or NSApplication event when become inactive

A NSStatusItem application,and set NSStatusItem's view as myView

[statusItem setView:myView];

so myView can be showed in the status bar, I can toggle a popover by clicking myView . I want to hide the popover when I click the other application, what means , how to get the event when my application is not active.

Upvotes: 0

Views: 477

Answers (1)

torrey.lyons
torrey.lyons

Reputation: 5589

In you application delegate you just have to add the following method:

- (void)applicationWillResignActive:(NSNotification *)aNotification

It will be called immediately before your application is about to deactivated.

Upvotes: 1

Related Questions