如何(以编程方式)检查用户是否在Mail.app中设置了电子邮件帐户。它似乎导致了崩溃。
干杯
答案 0 :(得分:22)
if ([MFMailComposeViewController canSendMail]) {
[self doStuff];
}
答案 1 :(得分:0)
Class mailClass =(NSClassFromString(@"MFMailComposeViewController"));
if(mailClass!=nil)
{
if ([mailClass canSendMail])
{
[self displayMailComposerSheet];
//compose box
}else
{
//email account not setup on the device.
}
}else
{
// problem in loading mail setup.
}