I have a problem with this piece of code when I create 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 create it with the base SDK 3.0, in case MFMailComposeViewController's initialization returns nil, which occurs if the user does not have mail accounts, the default "No mail accounts" notification system is launched by the system.
But when I create it with the base SDK 4.0 and deploy it for OS 3.0, if the user does not have email accounts, then the same warning is not displayed by the system, presentModalViewController fails instead.
MFMailComposeViewController's initialization returns nil if the user does not have mail accounts in both SDK 3.0 and 4.0, but somewhere presentModalViewController intelligently puts a warning in case of SDK 3.0, but SDK 4.0 deployed to 3.0 fails and fails.
Has anyone come across this problem / any ideas what is actually happening.
Thanks Raj
source share