iafonov
iafonov

Reputation: 5192

Cocoa: Return to previous active application?

is there a way to capture application that was previously active, before my application was brought to front by user?

I've tried to this in applicationWillBecomeActive: delegate method, but my application is already mark as active.

Thanks.

Upvotes: 3

Views: 858

Answers (1)

nall
nall

Reputation: 16149

Register for the NSWorkspaceDidDeactivateApplicationNotification notification in NSWorkspace. This will give you an NSRunningApplication instance of what was deactivated.

Upvotes: 9

Related Questions