本文介绍了如何在应用程序iphone中将.vcf文件添加为附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用中,我想将.vcf文件作为附件添加到MFMailComposeViewController中.

In my app I want to add .vcf file as attachment in MFMailComposeViewController.

推荐答案

文档显示,其 addAttachmentData:mimeType:fileName:实例方法是解决方法:

The documentation for MFMailComposeViewController shows that its addAttachmentData:mimeType:fileName: instance method is the way to go:

- (void)addAttachmentData:(NSData*)attachment mimeType:(NSString*)mimeType fileName:(NSString*)filename

附件是实际的vcf文件,已加载或转换为NSData.

The attachment is the actual vcf file loaded or transformed into NSData.

vcf的 mimeType @"text/x-vcard" .

fileName 是您想要的名称,尽管您应该使用.vcf扩展名来确保电子邮件程序能够理解它.

The fileName is whatever you want to call it, though you should uses the .vcf extension to ensure that email programs will understand it.

这篇关于如何在应用程序iphone中将.vcf文件添加为附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 21:53