setAccessoryView:
パネルにアクセサリービューを追加します
-(void)setAccessoryView:(NSView *)aView:
解説
パネルにアクセサリービューを追加します。
パネルの大きさに合わせて自動的にアクセサリービューの大きさを変更します。
アクセサリービュー(aView)をなし(nil)にするとアクセサリービューは削除されます。
返り値
( void )
なし
引数
( NSView * )aView
アクセサリービュー
フレームワーク
ApplicationKit
クラス
NSSavePanel
Instance Methods
使用可能
10.0
参照
- accessoryView
例文
#import "Controller.h" @implementation Controller - (IBAction)pushButton:(id)sender { NSSavePanel *spanel = [NSSavePanel savePanel]; [spanel setAccessoryView:acView]; [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 URL] absoluteString]); }else{ NSLog(@"Cansel"); } } @end