我是 Xcode 的新手(使用 4.3),不知道如何将图像保存到设备的相机胶卷。到目前为止,我所做的只是为按钮设置一个 IBAction 以保存图像。我可以使用什么库方法或函数将图像保存到用户的相机胶卷?
最佳答案
您使用 UIImageWriteToSavedPhotosAlbum()
功能。
//Let's say the image you want to save is in a UIImage called "imageToBeSaved"
UIImageWriteToSavedPhotosAlbum(imageToBeSaved, nil, nil, nil);
编辑:
//ViewController.m
- (IBAction)onClickSavePhoto:(id)sender{
UIImageWriteToSavedPhotosAlbum(imageToBeSaved, nil, nil, nil);
}
https://stackoverflow.com/questions/11131050/
相关文章:
objective-c - NSPredicate:按 NSDate 属性的日期过滤对象
objective-c - 在框架模块中包含非模块化 header
iphone - 使用 Cocoa 和 Objective-C 理解引用计数
objective-c - 如何使用 NSNotificationCenter 传递对象
iphone - SplitView 就像 iPhone 上的 Facebook 应用程序
objective-c - 将空格序列折叠成单个字符并修剪字符串
ios - 将参数传递给 addTarget :action:forControlEvents
objective-c - 为什么 Objective-C 不支持私有(private)方法?