addFileWrapper:
レシーバがディレクトリラッパーの場合、ラッパーを追加します
-(NSString *)addFileWrapper:(NSFileWrapper *)wrapper:
解説
レシーバがディレクトリラッパーの場合、ラッパーを追加します。
追加したラッパーの優先名を返します。
ラッパーに優先名がないとNSInternalInconsistencyExceptionが起こります。
返り値
( NSString * )
辞書キー
引数
( NSFileWrapper * )wrapper
ファイルラッパー
フレームワーク
ApplicationKit
クラス
NSFileWrapper
Instance Methods
使用可能
10.0
参照
- addFileWithPath:
- addRegularFileWithContents:preferredFilename:
- addSymbolicLinkWithDestination:preferredFilename:
- removeFileWrapper:
- fileWrappers
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSData *dat = [sender dataWithEPSInsideRect:[sender frame] ]; //ファイルラッパー NSFileWrapper *theWrapper = [[NSFileWrapper alloc] initDirectoryWithFileWrappers:nil]; NSFileWrapper *theWrapper2 = [[NSFileWrapper alloc] initRegularFileWithContents:dat]; [theWrapper setPreferredFilename:@"name1"]; [theWrapper2 setPreferredFilename:@"name2"]; NSLog([theWrapper addFileWrapper:theWrapper2]); NSLog([[theWrapper fileWrappers] description]); } @end