macOS/iOS API解説

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

目次

keyForFileWrapper:

ディレクトリラッパに含まれるファイルラッパの検索キーを返します
-(NSString *)keyForFileWrapper:(NSFileWrapper *)wrapper:

解説

ディレクトリラッパに含まれるファイルラッパの検索キーを返します。

返り値

( NSString * )

キー

引数

( NSFileWrapper * )wrapper

ファイルラッパ

フレームワーク

ApplicationKit

クラス

NSFileWrapper

Instance Methods

使用可能

10.0

参照

- filename

例文

#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 keyForFileWrapper:theWrapper2]);
    }

@end