2012-09-06 51 views

回答

1

你試過

NSString *content = @"content here"; 
NSData *fileContents = [content dataUsingEncoding:NSUTF8StringEncoding]; 
[[NSFileManager defaultManager] createFileAtPath:@"/my/path/to/file.csv" 
           contents:fileContents 
           attributes:nil]; 

如果你想有一個空白文件,嘗試設置contents:nil

相關問題