我有一个小的ui视图,允许用户选择pic形式的相机胶卷,我想将它与我的文本字段一起附在电子邮件中。
.h
@property (strong, nonatomic) IBOutlet UIImageView *imageView;
.m
NSString *emailBody = [NSString stringWithFormat:@(textboxes and other outlets are here)"%@"imageView.image];
通过电子邮件发送时我会附上文字字符串而不是图片吗? Coul dsomeone指出了我正确的方向,谢谢
xcode 4.3
答案 0 :(得分:0)
尝试此链接通过电子邮件发送图像
如果那不是您想要的,您可能需要使用函数将图像转换为nsdata
NSData *data=UIImageJPEGRepresentation(image, 1.0);
现在通过base64encoding将此数据转换为字符串,然后附加到字符串。