Cocoa mfmailcomposeviewcontroller在iOS 6上崩溃

Cocoa mfmailcomposeviewcontroller在iOS 6上崩溃,cocoa,ios6,Cocoa,Ios6,通常,当我像这样使用mfmailcomposeviewcontroller时: if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *mcvc = [[MFMailComposeViewController alloc] init]; mcvc.mailComposeDelegate = self; [mcvc setSubject:@"Che

通常,当我像这样使用mfmailcomposeviewcontroller时:

if ([MFMailComposeViewController canSendMail])
{

        MFMailComposeViewController *mcvc = [[MFMailComposeViewController alloc] init];
        mcvc.mailComposeDelegate = self;

        [mcvc setSubject:@"Check out these diamonds!"];

        [self presentModalViewController:mcvc animated:YES];
        [mcvc release];
}
我现在在iOS 6上遇到了这个错误:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: 'Could not load NIB in bundle: 'NSBundle </Users/ericshorr/Library/Application Support/iPhone Simulator/6.0/Applications/7904C2AD-23E1-4211-B5FA-A1F03CB3A875/SDE Group Diamonds.app> (loaded)' with name 'MFMailComposeInternalViewController''
***由于未捕获异常“NSInternalInconsistencyException”而终止应用程序,
原因:“无法在名为”MFMailComposeInternalViewController“的捆绑包:“NSBundle(loaded)”中加载NIB”

因为您需要在iPad中设置一个邮件帐户,才能在iOS 6中发送邮件。转到“设置”中的“邮件”、“联系人”、“日历”,然后添加一个邮件帐户。

我最近遇到了一个类似的问题,我在UIViewController中添加了一个类别,这样我就可以覆盖init并在nib名称中添加一个附加的修改器。就像这样

self = [self initWithNibName:[nibName stringByAppendingString:@"_modifier"] bundle:nil];
虽然UIViewController类别没有导入到尝试启动MFMailComposeViewController的类中,但它是导入到作为子视图控制器添加的其他类的标题中的。因此,MFMailComposeViewController试图找到名为MFMailComposeInternalViewController_修饰符的NIB

事后看来似乎很明显,但这是一场噩梦,所以我想我应该在这里加上它,作为一个可能的解决方案,对于任何遇到类似情况的人来说