【发布时间】:2014-05-21 05:11:02
【问题描述】:
我正在使用以下功能发送短信。
if([MFMessageComposeViewController canSendText])
{
MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];
controller.body = @"SMS Text";
controller.messageComposeDelegate = (id)self;
[self presentViewController:controller animated:TRUE completion:nil];
}
它在 iOS 7 及更高版本中运行良好。但它在运行 6.0.1 的 iPod 中崩溃并出现错误
* * NSDictionary 中的断言失败 *_UIRecordArgumentOfInvocationAtIndex(NSInvocation *, NSUInteger, BOOL)(), /SourceCache/UIKit/UIKit-2372/UIAppearance.m:1118
2014-05-21 11:33:38.170 Project[764:4913] * 由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“未知键,标题文本属性字典中的“NSColor”” * 首先抛出调用栈: (0x36c922a3 0x3346997f 0x36c9215d 0x383b430b 0x37717925 0x37716a7b 0x36c8f62f 0x377167f5 0x377f45e5 0x37782cd7 0x37782b6d 0x359d390f 0x37782a61 0x3778c0d5 0x359c683b 0x3778c0b1 0x359c611f 0x359c599b 0x359c5895 0x359d4215 0x359d43b9 0x36163a11 0x361638a4) libc++abi.dylib:终止调用抛出异常
任何帮助将不胜感激
【问题讨论】:
-
你能调试一下它在哪一行崩溃。试试这个,
[MFMessageComposeViewController canSendText] -
根据这个错误,尝试使用
UITextAttributeTextColor而不是NSForegroundColorAttributeName。