treatsFilePackagesAsDirectories
アプリケーションパッケージの中身を表示・選択できるようにするか返します
解説
アプリケーションパッケージの中身を表示・選択できるようにするか返します。
YES 表示・選択可能です。
NO 表示・選択可能ではありません。
返り値
( BOOL )
YES/NO
引数
フレームワーク
ApplicationKit
クラス
NSSavePanel
Instance Methods
使用可能
10.0
参照
- setTreatsFilePackagesAsDirectories:
例文
#import "Controller.h" //Localizable.stringsのJapaneseに "save_ok" = "保存するよ" としてUnicodeで保存してあります。 @implementation Controller - (IBAction)pushButton:(id)sender { NSSavePanel *spanel = [NSSavePanel savePanel]; [spanel setTreatsFilePackagesAsDirectories:YES]; [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){ if ([savePanel treatsFilePackagesAsDirectories]){ NSLog(@"YES"); }else{ NSLog(@"NO"); } NSLog([[savePanel requiredFileType] description]); }else{ NSLog(@"Cansel"); } } @end