writeToFile:ofType:
指定したタイプでファイルを書き出します
-(BOOL)writeToFile:(NSString *)fileName: ofType:(NSString *)type:
解説
指定したタイプでファイルを書き出します。
返り値
( BOOL )
YES/NO
引数
( NSString * )fileName
ファイル名
( NSString * )type
タイプ
フレームワーク
ApplicationKit
クラス
NSDocument
Instance Methods
使用可能
10.0
参照
- loadDataRepresentation:ofType:
- readFromFile:ofType:
- writeToFile:ofType:originalFile:saveOperation:
例文
- (IBAction)saveDocument:(id)sender { if ([self writeToFile:[@"~/docSaveFile1" stringByExpandingTildeInPath] ofType:@"txt" ]) { NSLog(@"YES"); }else{ NSLog(@"no"); } }