【发布时间】:2012-08-13 08:21:39
【问题描述】:
您好,我保存了一个 URL,该 URL 包含我将存储信息的目录的路径,现在我想检索信息但我不知道如何接收项目,我正在尝试使用 initWithContentsOfURL 但我不知道编码是什么吗?
这就是我保存 URL 的方式
//DirectoryPaths has the NSCAcheDirectory
dirPath = [[directoryPaths objectAtIndex:0] URLByAppendingPathComponent:[NSString stringWithFormat:@"photos.jpg"]];
我现在如何获取 URL 的路径?我试过了
NSString *pathToFile = [[NSString alloc] initWithContentsOfURL:dirPath
usedEncoding:nil
error:&error];
我不知道编码是什么,因为我没有使用编码来存储文件?
【问题讨论】:
标签: objective-c xcode nsurl nsfilemanager initwithcontentsofurl