出现了一个非常奇怪的错误
我的应用程序在iOS 5/.1中运行良好,但是在iOS 6中出现了一些过渡问题,但这个问题很令人困惑。
我有一些启动邮件编写器的代码,自从iOS 6以来,它会导致崩溃并显示以下错误:
* 在-[UICGColor encodeWithCoder:]中进行断言失败,/SourceCache/UIKit/UIKit-2372/UIColor.m:1191 2012-09-26 02:14:38.044 MyCQs Medical[2126:1b03] * Terminating app due to uncaught exception 'NSInternalInconsistencyException',reason: 'Only support RGBA or the White color space, this method is a hack.'
有什么建议吗?通过注释掉各种行进行试错,似乎是alloc/init行引起了错误,尽管当所有行都取消注释时,所有NSLog都被执行,包括“present”,这表明已经调用了应该调用的所有内容。应用程序在邮件合成器呈现在屏幕上之前崩溃,我真的很感激任何建议。
if (indexPath.row == 3) {
if([MFMailComposeViewController canSendMail]){
mailComposer = [[MFMailComposeViewController alloc]init];
NSLog(@"Alloc, init");
mailComposer.mailComposeDelegate = self;
NSLog(@"Set delegate");
NSArray *toArray = [[NSArray alloc]initWithObjects:@"john@doe.com", nil];
NSLog(@"To array");
[mailComposer setToRecipients:toArray];
NSLog(@"To recipients");
[mailComposer setSubject:@"Message from a MyCQs user!"];
NSLog(@"Subject");
NSLog(@"About to present mail composer");
[[mailComposer navigationBar] setTintColor:[UIColor blackColor]];
[self presentModalViewController:mailComposer animated:YES];
NSLog(@"Present");
}
}