setTitle:
セーブパネルのタイトルをセットします
-(void)setTitle:(NSString *)title:
解説
セーブパネルのタイトルをセットします。
初期設定は「保存」です。シートウインドウでは表示されません。
返り値
( void )
なし
引数
( NSString * )title
タイトル
フレームワーク
ApplicationKit
クラス
NSSavePanel
Instance Methods
使用可能
10.0
参照
- title
例文
#import "Controller.h" @implementation Controller - (IBAction)pushButton:(id)sender { NSSavePanel *spanel = [NSSavePanel savePanel]; [spanel setTitle:@"Title"]; [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 accessoryView] className]); }else{ NSLog(@"Cansel"); } } @end