簡體   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