if([MFMessageComposeViewController canSendText])
{
MFMessageComposeViewController *sms_message_vc = [[MFMessageComposeViewController alloc] init];
sms_message_vc.body = text;
sms_message_vc.recipients = recipients;
sms_message_vc.messageComposeDelegate = self;
[self presentModalViewController:sms_message_vc animated:FALSE];
[[UIApplication sharedApplication] setStatusBarHidden:TRUE];
[sms_message_vc release];
}
Khi điều này thực hiện, có độ trễ vài giây trước khi xem soạn được thực hiện. Điều gì gây ra điều này và làm thế nào để loại bỏ sự chậm trễ?Làm thế nào để loại bỏ độ trễ khi trình bày MFMessageComposeViewController?
CHỈNH SỬA 1: Làm rõ: Làm sms_message_vc
và ivar không giúp đỡ vì quy trình ...alloc] init]
sẽ treo giao diện người dùng trong vài giây, bất kể nó ở đâu.
EDIT 2: Cố gắng GCD (với các ưu tiên khác nhau) để cố gắng chạy khởi đồng thời. Không giúp:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, (unsigned long)NULL), ^(void){
sms_message_vc = [[MFMessageComposeViewController alloc] init];
sms_message_vc.messageComposeDelegate = self;
});
Có dalay quá nhiều thời gian? –