initRegularFileWithContents:
データでファイルラッパを作って初期化して返します
-(id)initRegularFileWithContents:(NSData *)contents:
解説
データでファイルラッパを作って初期化して返します。
返り値
( id )
ファイルラッパ
引数
( NSData * )contents
内容のデータ
フレームワーク
ApplicationKit
クラス
NSFileWrapper
Instance Methods
使用可能
10.0
参照
- setPreferredFilename:
- filename
- fileAttributes
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSData *dat = [sender dataWithEPSInsideRect:[sender frame] ]; //ファイルラッパー NSFileWrapper *theWrapper = [[NSFileWrapper alloc] initRegularFileWithContents:dat]; if ([theWrapper isRegularFile]){ NSLog(@"YES"); }else{ NSLog(@"NO"); } } @end