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

前端之家收集整理的这篇文章主要介绍了iphone – MFMessageComposeViewController在iOS7中显示空白屏幕前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
当我尝试使用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编辑器出现没有任何问题.

猜你在找的Xcode相关文章