use*_*625 8 iphone mms objective-c
我想从我的应用程序中撰写一条消息,我可以添加一张照片,例如:我在iPhone中输入了我的相册并打开了一张照片,我可以点击选项,然后在彩信标签上,照片将添加到一条消息中我可以把它发送给我想要的任何联系人.我想要的是,当我点击我的应用程序上的按钮时,将打开一个消息窗口,其中包含来自我在XCode中的资源的照片,我该怎么做?
Met*_*ete 15
Manu的答案对iOS6有好处,但对于iOS7,它们最终使用户流程变得简单:
MFMessageComposeViewController* composer = [[MFMessageComposeViewController alloc] init];
composer.messageComposeDelegate = self;
[composer setSubject:@"My Subject"];
// These checks basically make sure it's an MMS capable device with iOS7
if([MFMessageComposeViewController respondsToSelector:@selector(canSendAttachments)] && [MFMessageComposeViewController canSendAttachments])
{
NSData* attachment = UIImageJPEGRepresentation(myImage, 1.0);
NSString* uti = (NSString*)kUTTypeMessage;
[composer addAttachmentData:attachment typeIdentifier:uti filename:@"filename.jpg"];
}
[self presentViewController:composer animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11059 次 |
| 最近记录: |