开发者

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.

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜