I am creating a Note
kind of application using ARC
, where user can share his notes via Email. My problem is when I present a MFMailComposeViewController
then app is crashing with the below error :
*** Assertion failure in NSDictionary *_UIRecordArgumentOfInvocationAtIndex(NSInvocation *, NSUInteger, BOOL)(), /SourceCache/UIKit/UIKit-2380.17/UIAppearance.m:1118
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unknown key, "NSColor" in title text attributes dictionary'
The code is as follows:
if ([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
NSString *strSubject = [NSString stringWithFormat:@"A Note from %@", [prefs stringForKey:@"strAppTitle"]];
[picker setSubject:strSubject];
NSString *emailBody = strNoteText;
[picker setMessageBody:emailBody isHTML:NO];
[self presentViewController:picker animated:YES completion:nil];
}
I have implemented the MFMailComposeViewControllerDelegate
protocol. Can you please give me any suggestion that where i am doing wrong? Thanks