Type Property

sharedApplication

Returns the application instance, creating it if it doesn’t exist yet.

Declaration

@property(class, readonly, strong) __kindof NSApplication *sharedApplication;

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

Getting the Shared App Object

NSApp

The global variable for the shared app instance.