我有一个 iPad 应用程序,它由一个加载第二个视图控制器的根视图控制器组成。在第二个视图控制器中,我有一个按钮应该显示一个MFMailComposeViewController
.
我的问题是:
在模拟器上,这很好用。但是,在实际设备上,按下此按钮会锁定屏幕,并且似乎会禁用所有用户与界面的交互。
我的代码是:
//************** Send Email using Default IM ************************
-(void) showEmailModalView
{
NSLog(@"Start method <ExportStatisticsController> : <showEmailModalView> --");
// emailTextField.text = [emailTextField.text stringByReplacingOccurrencesOfString:@"(null)" withString:@""];
// subjectTextField.text = [subjectTextField.text stringByReplacingOccurrencesOfString:@"(null)" withString:@""];
// messageBodyTextView.text = [messageBodyTextView.text stringByReplacingOccurrencesOfString:@"(null)" withString:@""];
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self; // <- very important step if you want feedbacks on what the
//user did with your email sheet
[picker setSubject:@""];
NSArray *torec=[[NSArray alloc] initWithObjects:@"xyz@company.com", nil];
[picker setToRecipients:torec];
[torec release];
//------ message body ---
NSString *body =@"";
[picker setMessageBody:body isHTML:NO]; // depends. Mostly YES, unless you want to send it as plain text (boring)
picker.navigationBar.barStyle = UIBarStyleBlack; // choose your style, unfortunately, Translucent colors behave quirky.
// picker.ModalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:picker animated:YES];
[picker release];
NSLog(@"End method <ExportStatisticsController> : <showEmailModalView> --");
}
我做错了什么导致这样的屏幕冻结?