paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
documentsDirectory = [paths objectAtIndex:0];
fileName = [NSString stringWithFormat:@"%@/File.txt", documentsDirectory];
[self.data writeToFile:fileName atomically:NO];
其中
self.data的类型为NSMutableArray,用NSLog能看到self.data的内容,fileName也有,atomically:YES和NO都试了。程序没有报错,但是运行完打开指定文件夹没有文件生成,会是什么问题?
documentsDirectory = [paths objectAtIndex:0];
fileName = [NSString stringWithFormat:@"%@/File.txt", documentsDirectory];
[self.data writeToFile:fileName atomically:NO];
其中
self.data的类型为NSMutableArray,用NSLog能看到self.data的内容,fileName也有,atomically:YES和NO都试了。程序没有报错,但是运行完打开指定文件夹没有文件生成,会是什么问题?