Hi all,
I have a problem with this piece of code when I build it for different Base SDKs:
MFMailComposeViewController *mail = nil;
mail = [[MFMailComposeViewController alloc] init];
NSString *description = @"Some mail string";
if([MFMailComposeViewController canSendMail])
{
mail.mailComposeDelegate =self;
[mail setSubject:story.title];
[mail setMessageBody:[NSString stringWithFormat:(NSString *)kMessageBodyFormat,description,story.webLink] isHTML:NO];
}
[self presentModalViewController:mail animated:YES];
[mail release];
mail=nil;
When I build it with Base SDK 3.0, in case if MFMailComposeViewController's
initialization returns nil which occurs if the user does not has any mail accounts, the default "No mail accounts" alert is put up by the system.
But when I build it with Base SDK 4.0 and deploy it for 3.0 OS, if user does not has any mail accounts, the same alert is not displayed by the system, instead presentModalViewController
crashes.
MFMailComposeViewController's
initialization returns nil if user does not has any mail accounts in both 3.0 and 4.0 base SDK, but somewhere presentModalViewController
intelligently puts up the alert in case of SDK 3.0 but SDK 4.0 deployed on 3.0 fails and crashes.
Has anybody faced this problem / any ideas what actually is happening.
Thanks, Raj