我想通过iphone应用程序发送图片。
由于无法发送彩信,我找到了一些答案,谈到将图片作为短信附件发送。如何以编程方式执行此操作?
答案 0 :(得分:1)
以下是代码:
MFMessageComposeViewController *sms = [[MFMessageComposeViewController alloc]init];
[sms setMessageComposeDelegate:self];
[sms setRecipients:[NSArray arrayWithObject:@"123-4567"]];
[sms setSubject:@"Subject"];
[sms setBody:@"Body"];
[sms addAttachmentData:myData typeIdentifier:@"type" filename:myFile];
[sms setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self presentViewController:sms animated:YES completion:NO];
希望它有所帮助。