tags:

views:

74

answers:

1

Is there any way to detect when an app is no longer active? That is, listen for changes to this:

[NSApp isActive]
+5  A: 

In your app delegate, implement your choice of -applicationDidResignActive: or -applicationWillResignActive:.

Alternately, listen for the NSApplicationDidResignActiveNotification or NSApplicationWillResignActiveNotification notifications on NSApp.

Jim Puls
Ah, so there is a notification. Must have missed that in the documentation. Thanks Jim!