내 응용 프로그램에 하나의 메일에 여러 사진을 첨부하고 싶습니다. 이 코드로 마지막 한 장의 사진 만 메일에 첨부 할 수 있지만 uiimageview의 모든 사진을 읽을 수 있습니다. 어떻게 모든 사진을 첨부 할 수 있습니까? 하나의 메일에? 여기에 읽기 이미지의 코드입니다MFMailComposeViewController : 사진 붙이기 (멀티 사진)
- (void)elcImagePickerController:(ELCImagePickerController *)picker didFinishPickingMediaWithInfo:(NSArray *)info {
[self dismissModalViewControllerAnimated:YES];
////
if ([MFMailComposeViewController canSendMail]) {
MFMailComposeViewController * mailControler = [[MFMailComposeViewController alloc]init];
mailControler.mailComposeDelegate = self;
mailControler.modalPresentationStyle = UIModalPresentationFormSheet;
NSString *emailBody = @""; // optional
[mailControler setMessageBody:emailBody isHTML:YES];
for (UIView *v in [scrollview subviews]) {
[v removeFromSuperview];
}
CGRect workingFrame = scrollview.frame;
workingFrame.origin.x = 0;
for(NSDictionary *dict in info) {
imageview = [[UIImageView alloc] initWithImage:[dict objectForKey:UIImagePickerControllerOriginalImage]];
[imageview setContentMode:UIViewContentModeScaleAspectFit];
imageview.frame = workingFrame;
[scrollview addSubview:imageview];
[imageview release];
workingFrame.origin.x = workingFrame.origin.x + workingFrame.size.width;
NSLog(@"image %@", imageview.image);
NSData * data = UIImageJPEGRepresentation(imageview.image, 0.0);
[mailControler addAttachmentData:data mimeType:@"image/jpeg" fileName:@"Photos"];
}
[scrollview setPagingEnabled:YES];
[scrollview setContentSize:CGSizeMake(workingFrame.origin.x, workingFrame.size.height)];
}
일부 앱이 이미지를 구할 수
-1 특정 오류 메시지를 제공하지 않고 (정확하게 인용 한 경우) –