2013-09-23 174 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]]]; 

這對我有用。