Sets up a modal session with the given window and returns a pointer to the
NSModal structure representing the session.
- macOS 10.0+
The window for the session.
A pointer to the
NSModal structure that represents the session.
In a modal session, the app receives mouse events only if they occur in
a. The window is made key, and if not already visible is placed onscreen using the
begin method only sets up the modal session. To actually run the session, use
begin should be balanced by
end. Make sure these two messages are sent within the same exception-handling scope. That is, if you send
begin inside an
NS construct, you must send
If an exception is raised,
begin arranges for proper cleanup. Do not use
NS constructs to send an
end message in the event of an exception.
A loop using these methods is similar to a modal event loop run with
run, except the app can continue processing between method invocations.