shared
Returns the application instance, creating it if it doesn’t exist yet.
Declaration
class var shared: NSApplication { get }Mentioned in
Return Value
The shared application object.
Discussion
This method also makes a connection to the window server and completes other initialization. Your program should invoke this method as one of the first statements in main(); this invoking is done for you if you create your application with Xcode. To retrieve the NSApplication instance after it has been created, use the global variable NSApp or invoke this method.
See Also
Related Documentation
- Mac App Programming Guide
run()terminate(_:)