2013-09-23 169 views
4

当我尝试使用MFMessageComposeViewController发送大型收件人列表(例如多于40个)时,出现问题。在iOS7中,在显示SMS撰写视图之前,它会显示20秒或更长时间的空白屏幕。 iOS5和iOS6不会发生这种情况。MFMessageComposeViewController在iOS7中显示空白屏幕

下面是现有的代码,我使用,

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. 
+1

我有同样的问题。 我已经在bugreport.apple中打开了一个错误报告。com与ID#14994563 两天后,苹果工程师问我一个控制台日志,我已附加它,但是,现在什么都没有发生。我写了许多线程在苹果开发者论坛没有找到任何解决方案...今天我写信给蒂姆厨师.. – mi0772

+0

这是一个奇怪的错误。在我测试过的4个iPhone5设备中,有2个遇到了这个问题,而另外2个则立即显示了SMS撰写视图。我很困惑。 – LDWP

+1

我遇到了与我交付的应用程序相同的问题。似乎低于30左右接触,但逐渐延长的时间超过了这个时间。 86根本没有回报!最好的猜测是,这涉及到联系人现在根据将用于发送它们的方法进行着色的方式。在iPad上,您现在可以看到一系列的旋转器出现在每个联系人上,因为无论他们是否知道iMessage。我不确定这是否是iOS7的后期补充,但我没有在beta版中看到这个东西。 –

回答

-2

该问题已在iOS 7.0.3中解决。

+0

只有超时等待屏障从com.apple.mobilesms.compose出现在7.0.4上 –

+6

也在8.1.1上得到这个。耶苹果! – simonthumper

+0

问题也在8.0.2版本 –

2

我到过然后同样的问题想通

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

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

4

我有一个类似的问题在那里我得到了在控制台“

消息超时从com.apple.mobilesms.compose

问题等待围栏阻隔了,我试图在我的应用程序添加的号码作为一个字符串,但由于国产化要求的,我已经把它放在一个表格:NSArray *recipents = @[NSLocalizedString(@"numberForRegistrationViaSms", @"")];

[messageController setRecipients:@[recipents]]; 

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

1

我想我可能解决此问题:

//必须启动新的NSString对象

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

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

Then OK. 

1

我有同样的问题。

  • 超时从取消com.apple.mobilesms.compose

  • 消息

代替此等待围栏阻挡:

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

Ť ry this:

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

这对我有用。