Makes the receiver the active app.
- macOS 10.0+
false, the app is activated only if no other app is currently active. If
true, the app activates regardless.
flag parameter is normally set to
false. When the Finder launches an app, using a value of
flag allows the app to become active if the user waits for it to launch, but the app remains unobtrusive if the user activates another app. Regardless of the setting of
flag, there may be a time lag before the app activates—you shouldn’t assume the app will be active immediately after sending this message.
You rarely need to invoke this method. Under most circumstances, AppKit takes care of proper activation. However, you might find this method useful if you implement your own methods for inter-app communication.
You don’t need to send this message to make one of the app’s
NSWindows key. When you send a
make message to an
NSWindow object, you ensure that it’s the key window when the app is active.