App Does Not Run On All

I have an issue where the emulator behaves differently then the actual iPhone when running my Xcode app, (it has nothing to do with email). What could be the issue?

Replies

I guess you're not setting up email on your device. According to Apple document:

Before presenting the mail compose view controller, always call the the canSendMail() method to see if the current device is configured to send email. If the user’s device is not set up for the delivery of email, you can notify the user or simply disable the email dispatch features in your application. You should not attempt to use this interface if the canSendMail() method returns false.

if !MFMailComposeViewController.canSendMail() {
    print("Mail services are not available")
    return
}