更新时间:2023-09-27 23:18:58
获取 NSDocuments
目录使用:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"MyFile.txt"];
如何重命名您可以在此处找到的文件:
How to rename file you can find here:
如果您不知道文档目录中文件的名称,您可以使用:
If you do not know the names of the files in documents directory you can use :
NSArray *directoryContent = [fileManager contentsOfDirectoryAtPath:documentsDirectory error:nil];
该数组包含您需要的所有文件名.所以你可以重命名它们.
This array contains all filenames you need. So you can rename them all.