加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

iphone – MFMessageComposeViewController在iOS7中显示空白屏幕

发布时间:2020-12-14 17:50:24 所属栏目:百科 来源:网络整理
导读:当我尝试使用MFMessageComposeViewController发送大型收件人列表(例如超过40个)时出现问题.在iOS7中,在显示SMS撰写视图之前,它将显示20秒或更长时间的空白屏幕. iOS5和iOS6不会发生这种情况. 以下是我正在使用的现有代码, NSArray * recipients;for (NSIndex
当我尝试使用MFMessageComposeViewController发送大型收件人列表(例如超过40个)时出现问题.在iOS7中,在显示SMS撰写视图之前,它将显示20秒或更长时间的空白屏幕. iOS5和iOS6不会发生这种情况.

以下是我正在使用的现有代码,

NSArray * recipients;

for (NSIndexPath * index in selectedRows) 
{ 
   NSDictionary *dictionary = [data objectAtIndex:index.row];
   NSString *phoneNum =  [dictionary objectForKey:@"contactNum"];
   recipients = [NSArray arrayWithObjects:phoneNum,nil]];
}

MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];

if([MFMessageComposeViewController canSendText])
{
    controller.body = bodyOfMessage;
    controller.recipients = recipients;
    controller.messageComposeDelegate = self ;
    controller.wantsFullScreenLayout = NO;
    [(id)_delegate presentModalViewController:controller animated:YES];
    [[UIApplication sharedApplication] setStatusBarHidden:YES];
}

以下是我尝试发送给许多人时收到的输出消息.

timed out waiting for fence barrier from com.apple.mobilesms.compose
Received memory warning.
Received memory warning.
Received memory warning.
Received memory warning.
Received memory warning.
Received memory warning.
Received memory warning.
Received memory warning.
Received memory warning.

解决方法

我有一个类似的问题,我在控制台中收到消息“

timed out waiting for fence barrier from com.apple.mobilesms.compose

问题是我在我的应用程序中尝试将数字添加为字符串,但由于本地化请求,我将其放在一个表单中:NSArray * recipents = @ [NSLocalizedString(@“numberForRegistrationViaSms”,@“”)] ;

[messageController setRecipients:@[recipents]];

由于某种原因这不起作用,但是,当我简单地说,[messageController setRecipients:@ [@“123456789”]];时,SMS编辑器出现没有任何问题.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读