runModal(for:modalDelegate:didEnd:contextInfo:)
Runs the receiver modally as a sheet attached to a specified window.
Declaration
func runModal(for window: NSWindow, modalDelegate delegate: Any?, didEnd didEndSelector: Selector?, contextInfo: UnsafeMutableRawPointer?)Parameters
- window:
The parent window for the sheet.
- delegate:
The delegate for the modal session.
- didEndSelector:
A message sent to the delegate after the user responds but before the sheet is dismissed.
- contextInfo:
Contextual data passed to the delegate in the
didEndSelectormessage.
Discussion
The didEndSelector parameter is a selector that takes three arguments. The corresponding method should have a declaration modeled on the following example:
- (void)identityPickerDidEnd:(CBIdentityPicker *)identityPicker returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;where the identityPicker argument is the identity picker object, the returnCode argument is the button the user clicked, and contextInfo is the same contextInfo argument that was passed in the original message.