我目前正在使用iOS7和MFMailComposeViewController.有时(经常但不总是),我在呈现时遇到以下崩溃MFMailComposeViewController:
***断言失败 - [MFComposeSubjectView layoutSublayersOfLayer:],/ SourceCache/UIKit/UIKit-2903.23/UIView.m:8540
这是我如何呈现控制器:
if ([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController* mailVC = [[MFMailComposeViewController alloc] initWithNibName:nil bundle:nil];
mailVC.mailComposeDelegate = self;
[mailVC setSubject:@"blablabla"]];
[mailVC setMessageBody:@"blablabla" isHTML:NO];
mailVC.modalPresentationStyle = UIModalPresentationFormSheet;
mailVC.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
if(isIpad) {
[sharedParentViewController presentViewController:mailVC animated:YES completion:nil];
} else {
[sharedNavigationViewController presentViewController:mailVC animated:YES completion:nil];
}
}
Run Code Online (Sandbox Code Playgroud)
sharedParentViewController并sharedNavigationViewController定义了宏来访问应用程序中的任何位置的根视图控制器.
我为所有例外设置了一个断点,但不幸的是,它从未打破过.
使用iOS6和iOS5,一切正常,任何想法,我可以尝试解决这个问题?
编辑:
这是崩溃日志:
Stack Trace
Auto Layout still required after executing -layoutSubviews. MFComposeSubjectView's implementation of -layoutSubviews needs to call super.
0 CoreFoundation 0x3099ff4b <redacted> …Run Code Online (Sandbox Code Playgroud) cocoa-touch objective-c ios ios7 mfmailcomposeviewcontroller