Objective-C – 将GPS信息添加到照片

我想知道是否有可能将GPS信息添加到照片时,将项目保存到相机胶卷。

我目前用来保存图像的代码是:

UIImage *theImage = (UIImage *)[info objectForKey: UIImagePickerControllerOriginalImage]; UIImageWriteToSavedPhotosAlbum(theImage, self, @selector(image:didFinishSavingWithError:contextInfo:), nil); 

我想知道如何修改图像EXIF数据以添加当前位置,并使其与iPhone上的“位置”function兼容。

这个例子: http : //caffeinatedcocoa.com/blog/?p=7解释如何更新照片的date。 转到CGImageProperties Reference ,并用相关的GPS键replace示例中的键kCGImagePropertyExifDateTimeDigitized。 我自己并没有尝试这个,但听起来像应该工作。 🙂