gpt4 book ai didi

ios - _UIViewServiceInterfaceErrorDomain

转载 作者:技术小花猫 更新时间:2023-10-29 10:27:44 24 4
gpt4 key购买 nike

我在使用 MFMailComposeViewController 时遇到问题

我遇到了这个错误

viewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 3.)" UserInfo=... {Message=Service Connection Interrupted}

使用此代码

- (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];
}
}

最佳答案

这是 iOS 8 模拟器的一个已知问题。请看this post寻找可能的解决方法。

You MUST allocate and initiate MFMailComposeViewController in an earlier stage, and hold it in one static variable, whenever it's needed, get the static MFMailComposeViewController instance and present it.

AND you will almost certainly have to "cycle" the global MFMailComposeViewController after each use. It is not reliable to "re-use" the same one. Have a global routine which release and then re-initializes the singleton MFMailComposeViewController. Call it each time after you are finished with it

归功于 "Joe Blow"为职位。从您的代码来看,您已经声明了全局邮件编辑器。按照帖子的建议尝试“回收”它,看看是否能解决您的问题。我有同样的问题,不幸的是这个解决方案不能解决我的问题。我可以确认此解决方案适用于 iOS 7.1 模拟器,但不适用于 iOS 8,尽管有人建议它适用于 iOS 8 物理设备。

关于ios - _UIViewServiceInterfaceErrorDomain,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25961068/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com