Contents

run()

Starts the main event loop.

Declaration

func run()

Discussion

The loop continues until a stop(_:) or terminate(_:) message is received. Upon each iteration through the loop, the next available event from the window server is stored and then dispatched by sending it to NSApp using sendEvent(_:).

After creating the NSApplication object, the main function should load your app’s main nib file and then start the event loop by sending the NSApplication object a run() message. If you create an Cocoa app project in Xcode, this main function is implemented for you.

See Also

Related Documentation

Managing the event loop