我的应用程序行为异常。以这种方式保存图像:
NSData *pngData = UIImageJPEGRepresentation(self, 1.0);
NSString *filePath = [self documentsPathForFileName:imageName];
[pngData writeToFile:filePath atomically:YES];
- (NSString *)documentsPathForFileName:(NSString *)name {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsPath = [paths objectAtIndex:0];
return [documentsPath stringByAppendingPathComponent:name];
}
然而,在进行iphone备份并恢复之后。应用程序包含所有数据,但图片未恢复。可能是什么原因?