我在获取从照片库或相机拍摄的图像名称时遇到问题。我已成功选择图像,但我想使用 MFMailComposeViewController 将选择的图像作为电子邮件附件发送。问题是 MFMailComposeViewController 需要图像的特定名称。我使用以下代码获取图像名称,它总是返回“assest.JPG”,这不适用于 MFMailComposeViewController
- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo{
[imageView setImage:image];
image_ = image;
image_ = [UIImage imageNamed:@"file.jpg"];
NSURL *imagePath = [editingInfo objectForKey:@"UIImagePickerControllerReferenceURL"];
imageName = [imagePath lastPathComponent];
NSLog(@"%@",imageName);
[self dismissModalViewControllerAnimated:YES];
if (CAMORLIB == 1) {
UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
}}
有没有其他方法来处理这个问题?
谢谢,
穆罕默德