runModal
アラートウインドウを表示します。
10.9以降ではbeginSheetModalForWindow:completionHandlerを使用します。
- (NSModalResponse)runModal
func runModal() -> NSModalResponse
解説
アラートウインドウを表示します。
引数
なし
フレームワーク
ApplicationKit
クラス
NSAlert
使用可能
10.3
編集時のバージョン
OS X 10.10
参照
beginSheetModalForWindow:completionHandler
-beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:
例文
[alert setShowsHelp:YES]; [alert runModal];
//NSAlert runModal @IBAction func function009(sender: AnyObject) { //なにかモーダルがあっても終わり NSApp.abortModal() //テキストの作成 let messageText:String = "Message text" as String let informativeText:String = "Information text" as String //NSAlertの作成 let alert:NSAlert = NSAlert() alert.alertStyle = .WarningAlertStyle alert.messageText = messageText alert.informativeText = informativeText alert.delegate = self let response:Int = alert.runModal() }