【发布时间】:2012-10-20 09:45:46
【问题描述】:
我在临时更新后从应用的文档文件夹加载现有图像时遇到问题。
我在互联网上搜索了答案,我发现我必须使用文件的相对路径,以便在更新应用程序时路径保持不变。
有人可以告诉我怎么做吗?
现在我使用以下方法在 ImagePicker 完成时保存文件(图像):
NSString *imageFilename = [NSString stringWithFormat:@"%@-profilePhoto.jpg",[NSDate date]];
NSArray *paths = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
imagePath = [NSString stringWithFormat:@"%@/%@", paths, imageFilename];
请帮帮我!
【问题讨论】:
-
请 NSLog 图像路径和控制台上显示的内容?
标签: objective-c ios xcode nsfilemanager