这是我尝试编译项目时遇到的错误:
Undefined symbols for architecture armv7:
"_writeImageToSavedPhotosAlbum", referenced from:
-[AddNewPhotoViewController imagePickerController:didFinishPickingMediaWithInfo:] in AddNewPhotoViewController.o
调用时出现错误writeImageToSavedPhotosAlbum
。我怀疑错误与未导入必要的框架有关,但我不知道要导入什么。
有什么帮助吗?
编辑
这是我的writeImageToSavedPhotosAlbum
代码:
- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
// Access the uncropped image from info dictionary
UIImage *image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
[self dismissModalViewControllerAnimated:YES];
[_CameraOutput setImage:image];
writeImageToSavedPhotosAlbum(image, nil, @selector(image:didFinishSavingWithError:contextInfo:));
}
编辑#2 我在我的 .m 文件中包含了以下导入:
#import <AssetsLibrary/AssetsLibrary.h>