我正试图从Xcode 6开始在iOS 8中打开电子邮件,但收到错误.如果我从Xcode 5尝试,相同的代码工作正常.后来我从apple开发人员门户网站下载了一个示例代码:
https://developer.apple.com/library/content/samplecode/MessageComposer/Introduction/Intro.html
但结果是一样的.有什么东西,或某些设置,我缺少优化Xcode 6的代码
这是代码:在我的按钮操作中
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"Hello from California!"];
// Set up recipients
NSArray *toRecipients = [NSArray arrayWithObject:@"first@example.com"];
NSArray *ccRecipients = [NSArray arrayWithObjects:@"second@example.com", @"third@example.com", nil];
NSArray *bccRecipients = [NSArray arrayWithObject:@"fourth@example.com"];
[picker setToRecipients:toRecipients];
[picker setCcRecipients:ccRecipients];
[picker setBccRecipients:bccRecipients];
// Attach an image to the email
NSString *path = [[NSBundle mainBundle] pathForResource:@"rainy" ofType:@"jpg"];
NSData *myData = [NSData dataWithContentsOfFile:path];
[picker addAttachmentData:myData mimeType:@"image/jpeg" fileName:@"rainy"];
// Fill out the email body text
NSString *emailBody …Run Code Online (Sandbox Code Playgroud) 当我在我的项目中整合Instagram时.我得到一个image从UIImagePickerController后它,我想将它发送到Instagram的但是当我发送image到Instagram的通过UIDocumentInteractionController委托方法presentOptionsMenuFromRect:inView: animated: 是这样
[documentInteractionController presentOptionsMenuFromRect:CGRectZero inView:self.view animated:YES];
Run Code Online (Sandbox Code Playgroud)
警告出现警告:在演示文稿正在进行时尝试显示<_UIDocumentActivityViewController:0x7584780>!
该应用程序不是崩溃.但我没有得到问题.为什么会出现此警告及其含义.我在互联网上搜索并阅读有关此问题,但没有得到任何答案.帮我 !!
当我使用iphone 5s的模拟器时,在邮件发送过程中出现这样的错误,并在ios 7模拟器中完美运行.它甚至不显示发送选项,只有在打开邮件发送页面时才会出现取消选项.我该怎么做才能解决它请帮助我.先感谢您
错误:-
'_serviceViewControllerReady:error:Error Domain = NSCocoaErrorDomain Code = 4097"操作无法完成.(Cocoa error 4097.)"(连接到名为com.apple.uikit.viewservice.com.apple.MailCompositionService的服务){NSDebugDescription =连接到名为com.apple.uikit.viewservice.com.apple.MailCompositionService}的服务
viewServiceDidTerminateWithError:'Error Domain = _UIViewServiceInterfaceErrorDomain Code = 3"无法完成操作.(_UIViewServiceInterfaceErrorDomain error 3.)"{Message = Service Connection Interrupted}'
我遇到了问题 MFMailComposeViewController
我收到了这个错误
viewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 3.)" UserInfo=... {Message=Service Connection Interrupted}
Run Code Online (Sandbox Code Playgroud)
用这个代码
- (IBAction) mailbutton:(id)sender
{
if([MFMailComposeViewController canSendMail])
{
[MSAPP.globalMailComposer setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[self presentViewController:MSAPP.globalMailComposer animated:YES completion:nil];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
message:@"Unable to mail. No email on this device?"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[MSAPP cycleTheGlobalMailComposer];
}
}
Run Code Online (Sandbox Code Playgroud) 我的应用程序有一个文档交互控制器,用于打开其他应用程序中的文档.以下代码显示一个按钮,用于打开"打开方式"菜单,允许用户在其他应用程序中打开文件 - 例如,如果用户在"打开方式"菜单中选择了邮件应用程序,则通过邮件发送,邮件应用程序创建一封新电子邮件,并自动将该文件附加到邮件正文.
以下代码在iOS7中运行良好,但在iOS8 +上停止运行良好.文件未附加到邮件,我收到错误日志消息.
UIDocumentInteractionController声明:
@property (nonatomic, strong) UIDocumentInteractionController* interactionController;
Run Code Online (Sandbox Code Playgroud)
初始化:
self.interactionController = [UIDocumentInteractionController interactionControllerWithURL:self.url];
self.interactionController.delegate = self;
self.interactionController.name = self.file.name;
Run Code Online (Sandbox Code Playgroud)
要求"打开"菜单:
[self.interactionController presentOpenInMenuFromBarButtonItem:self.openInBarButtonItem animated:YES];
Run Code Online (Sandbox Code Playgroud)
打开excel文件后收到的错误消息示例:
提供的未知活动项目:({"com.microsoft.excel.xls"= <504b0304 .... 000000>;},"")
viewServiceDidTerminateWithError:Error Domain = _UIViewServiceInterfaceErrorDomain Code = 3"无法完成操作.(_UIViewServiceInterfaceErrorDomain error 3.)"UserInfo = 0x ... {Message = Service Connection Interrupted}(lldb).
我很感激任何想法来解决这个问题.
谢谢,Ori
ios ×3
ios8 ×3
objective-c ×2
cocoa-touch ×1
email ×1
iphone ×1
mfmailcomposeviewcontroller ×1
swift ×1
xcode ×1
xcode6gm ×1