Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 从 iOS 上的 UIView 将图像保存到应用程序文档文件夹
我想以编程方式将图像存储在我的应用程序文件夹中,由 UIImagePiker(相机或相册)拍摄。我是iOS编程的初学者。
保存图像:
-(void)saveImage:(UIImage*)image { NSString *imagePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/aName.png"]; [UIImagePNGRepresentation(image) writeToFile:imagePath atomically:YES]; }