2015-09-26 75 views
0

我可以檢查是否在iPhone上配置了此電子郵件客戶端:如何以編程方式打開電子郵件配置表?

if ([MFMailComposeViewController canSendMail]) 
{ 
    // Actions to send mail 
} 
else 
{ 
    //Actions to show an error message by UIAlertView 
} 

我怎樣才能將用戶重定向到電子郵件帳戶配置表我沒有電子郵件帳戶配置了嗎?

回答

2

您可以打開首選項應用,但不能更多。從iOS8開始,只需使用以下代碼:

NSURL *settingsAppURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; 
[[UIApplication sharedApplication] openURL:settingsAppURL]; 
+0

應用程序在哪裏正確地完成它。 – confile

相關問題