macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

webView:runJavaScriptConfirmPanelWithMessage:

Javascriptでアラートを表示しようとしたときに呼び出されます。
-(BOOL)webView:(WebView *)sender:
            runJavaScriptConfirmPanelWithMessage:(NSString *)message:

解説

Javascriptでアラートを表示しようとしたときに呼び出されます。

返り値

( BOOL )

YES/NO

引数

( WebView * )sender
( NSString * )message

クラス

WebUIDelegate

Instance Methods

使用可能

10.2

参照

webView:runJavaScriptAlertPanelWithMessage:
webView:runJavaScriptTextInputPanelWithPrompt:defaultText:

例文

//JavaScript
-(void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message
{
//NSLog(@"runJavaScriptAlertPanelWithMessage");
NSAlert *alert = [NSAlert alertWithMessageText:@"alertWithMessageText"
                defaultButton:@"defaultButton"
                alternateButton:@"alternateButton"
                otherButton:@"otherButton"
                informativeTextWithFormat:@"informativeTextWithFormat %@",@"text"
                ];

[alert beginSheetModalForWindow:[sender window]
            modalDelegate:self
            didEndSelector:@selector(endAlert)
            contextInfo:nil
            ];

}
-(void)endAlert
{
NSLog(@"end");
}