当我为不同的 Base SDK 构建这段代码时,我遇到了问题:
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;
当我使用 Base SDK 3.0 构建它时,如果MFMailComposeViewController's
初始化返回 nil(如果用户没有任何邮件帐户),则系统会发出默认的“无邮件帐户”警报。
但是当我使用 Base SDK 4.0 构建它并将其部署到 3.0 操作系统时,如果用户没有任何邮件帐户,系统不会显示相同的警报,而是presentModalViewController
崩溃。
MFMailComposeViewController's
如果用户在 3.0 和 4.0 基本 SDK 中都没有任何邮件帐户,则初始化返回 nil,但presentModalViewController
在 SDK 3.0 但部署在 3.0 上的 SDK 4.0 失败并崩溃的情况下,某个地方会智能地发出警报。
有没有人遇到过这个问题/任何想法实际上发生了什么。
谢谢,拉吉