prompt
「OK」ボタンのタイトルを返します
解説
「OK」ボタンのタイトルを返します。
ローカライズされた文字列が返されます。
返り値
( NSString * )
プロンプト
引数
フレームワーク
ApplicationKit
クラス
NSSavePanel
Instance Methods
使用可能
10.0
参照
- setPrompt:
例文
#import "Controller.h" //Localizable.stringsのJapaneseに "save_ok" = "保存するよ" としてUnicodeで保存してあります。 @implementation Controller - (IBAction)pushButton:(id)sender { NSSavePanel *spanel = [NSSavePanel savePanel]; [spanel setPrompt:NSLocalizedString(@"save_ok",nil)]; [spanel setRequiredFileType:@"rtfd"]; [spanel beginSheetForDirectory:NSHomeDirectory() file:nil modalForWindow:myWindow modalDelegate:self didEndSelector:@selector(didEndSaveSheet:returnCode:conextInfo:) contextInfo:NULL]; } -(void)didEndSaveSheet:(NSSavePanel *)savePanel returnCode:(int)returnCode conextInfo:(void *)contextInfo { if (returnCode == NSOKButton){ NSLog([savePanel prompt]); }else{ NSLog(@"Cansel"); } } @end