NSAlert:alertStyle
Home 目次>ApplicationKit>NSAlert
10.3

alertStyle

アラートスタイルを返します


-(NSAlertStyle) alertStyle


【返り値】
   NSAlertStyleアラートスタイル


【解説】

【NSAlertStyle】アラートスタイル
●NSWarningAlertStyle 注意パネル
●NSInformationalAlertStyle 情報パネル
●NSCriticalAlertStyle 警告パネル



【例文】


switch ([alert alertStyle]){
case NSWarningAlertStyle:
NSLog(
@"NSWarningAlertStyle" );
break ;
case NSInformatio #import "MyObject.h"

@implementation MyObject

- (
IBAction )myAction:( id )sender
{
// アラートパネルを作成
NSAlert *alert = [NSAlert alertWithMessageText: @"alertWithMessageText"
defaultButton:
@"defaultButton"
alternateButton:
@"alternateButton"
otherButton:
@"otherButton"
informativeTextWithFormat:
@"informativeTextWithFormat %@" , @"text"
];
// ボタンを追加
[alert addButtonWithTitle: @"add" ];
//
[alert setDelegate:delegateObject];
// ヘルプボタンをつける
[alert setShowsHelp: YES ];
// シートで表示
[alert beginSheetModalForWindow:[sender window]
modalDelegate:
self
didEndSelector:
@selector (endAlert)
contextInfo:
nil
];
// アラートスタイルを表示
switch ([alert alertStyle]){
case NSWarningAlertStyle:
NSLog(
@"NSWarningAlertStyle" );
break ;
case NSInformationalAlertStyle:
NSLog(
@"NSInformationalAlertStyle" );
break ;
case NSCriticalAlertStyle:
NSLog(
@"NSCriticalAlertStyle" );
break ;
}

}
// パネルが終わった時の処理
-( void )endAlert
{
NSLog(
@"end" );
}

@end
nalAlertStyle:
NSLog(
@"NSInformationalAlertStyle" );
break ;
case NSCriticalAlertStyle:
NSLog(
@"NSCriticalAlertStyle" );
break ;
}


(C) 2000-2007 Satoshi Oomori.
[Apple]

Google
Webwww.oomori.com
Apple_Store_40x120

[ad:Usual day in Japan]

この記事を評価してください。 

良い 

間違いがある 説明がわかりにくい 例文がわかりにくい  

Home 目次>ApplicationKit>NSAlert
修正日2007.5.28