Check if user has email set up on their iDevice?
How do you check (programmatically) if 开发者_StackOverflow中文版a user has set up an email account in Mail.app. It seems to be causing a crash.
Cheers
if ([MFMailComposeViewController canSendMail]) {
[self doStuff];
}
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.
}
精彩评论