macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

removeFileWrapper:

ディレクトリラッパから、ファイルラッパを取り除きます
-(void)removeFileWrapper:(NSFileWrapper *)wrapper:

解説

ディレクトリラッパから、ファイルラッパを取り除きます。

返り値

( void )

なし

引数

( NSFileWrapper * )wrapper

ラッパー

フレームワーク

ApplicationKit

クラス

NSFileWrapper

Instance Methods

使用可能

10.0

参照

- addFileWithPath:
- addFileWrapper:
- addRegularFileWithContents:preferredFilename:
- addSymbolicLinkWithDestination:preferredFilename:
- 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]);

[theWrapper removeFileWrapper:theWrapper2];
    }

@end