I’d like to do some things in my mac app when a user starts using another app or the Finder and my app isn’t in focus anymore.
How do I do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can observe the
NSApplicationDidResignActiveNotificationto find out when you aren’t the active application anymore. This and related notifications are documented in the NSApplication Class Reference.If you don’t know how to observe notifications, you will want to read Notification Programming Topics.