以下行在 iPad 上崩溃。我正在使用带有 6.0 的 Xcode 4.6.3 (4H1503) 作为目标操作系统平台。它曾经工作得很好!
if ([MFMailComposeViewController canSendMail]) {
MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init];
[self presentViewController:mailViewController animated:YES completion:nil];
}
除了以下例外:
2013-09-04 02:30:47.489 MyProject[38633:5b0b] * NSDictionary 中的断言失败 *_UIRecordArgumentOfInvocationAtIndex(NSInvocation *, NSUInteger, BOOL)(), /SourceCache/UIKit_Sim/UIKit-2380.17/UIAppearance.m:1118
2013-09-04 02:31:00.816 MyProject [38633:5b0b] *由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“未知键,“{size = 13.000000,traits = 00000000}”在标题文本属性字典中
编辑:由于以下几行而崩溃。猜猜为什么?没想到和...MFMailComposeViewController
有任何关系UITabBarItem
NSDictionary *textAttributesDict = @{ [UIColor whiteColor] : UITextAttributeTextColor,
[UIFont systemFontOfSize:13.0f] : UITextAttributeFont};
[[UITabBarItem appearance] setTitleTextAttributes:textAttributesDict forState:UIControlStateSelected];
[[UITabBarItem appearance] setTitleTextAttributes:textAttributesDict forState:UIControlStateNormal]`;