繁体   English   中英

MFMessageComposeViewController在iOS7中显示空白屏幕

[英]MFMessageComposeViewController shows blank white screen in 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.

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

从com.apple.mobilesms.compose等待篱笆障碍超时

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

[messageController setRecipients:@[recipents]];

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

我想到了同样的问题

controller.recipients = //应该始终是一个字符串数组。

确保发送给controller.recipients的电话号码是NSString。

我想我可能会解决这个问题:

//必须启动新的NSString对象

NSString *phoneStr = [NSString stringWithFormat:@"%@",... ];                                                     

MFMessageComposeViewController *aCtrl = [[MFMessageComposeViewController alloc] init];
aCtrl.recipients                      = @[phoneStr];
...

Then OK.

我有同样的问题。

  • 从com.apple.mobilesms.compose等待篱笆障碍超时

  • 消息已取消

而不是这个:

    NSString *phoneNumber = @"888888888";
    [picker setRecipients:@[phoneNumber]];

试试这个:

    NSString *phoneNumber = person.phoneNumber;
    [picker setRecipients:@[[NSString stringWithFormat:@"%@", phoneNumber]]];

这对我有用。

该问题已在iOS 7.0.3中得到解决。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM