Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7658913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:15:49+00:00 2026-05-31T13:15:49+00:00

Exception Message: Objective-C exception thrown. Name: NSInvalidArgumentException Reason: Application tried to present a nil

  • 0

Exception Message:

Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: 
Application tried to present a nil modal view controller on target <Navigator: 0x1bed0d0>.

Here is my code:

    partial void BtnTest (MonoTouch.Foundation.NSObject sender)
    {
        MFMailComposeViewController view = new MFMailComposeViewController();
        view.SetToRecipients(new string[]{"blubb@blubb.de"});
        view.SetMessageBody("Hier steht nun der zusammengestellt text :)", false);
        //view.MailComposeDelegate = new CustomMailComposeDelegate();
        view.SetSubject("Test");

        view.Finished += (s,e)=>
                     {
                            this.NavigationController.DismissModalViewControllerAnimated(true);
        };

        this.BeginInvokeOnMainThread(()=>
        {
            this.NavigationController.PresentModalViewController(view, true);
        });

    }

It works on iPad Emulator but not on the Device.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:15:50+00:00Added an answer on May 31, 2026 at 1:15 pm

    Is your device configured to send emails ? note that even if it is you should not consider it will be the case on every user devices.

    IWO you should call MFMailComposeViewController.CanSendMail like this is documented by Apple. Two important quotes:

    you must always check to see if the current device is configured to send email at all using the canSendMail method

    and

    You should not attempt to use this interface if the canSendMail method returns NO.

    Example:

       if (MFMailComposeViewController.CanSendMail) {
           ... your code ...
       } else {
           ... show warning, like an UIAlertView
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get an exception in my J2ME application and the exception message is :
This is the Exception message thrown by Gen_server when its not started. (ankit@127.0.0.1)32> R11
The exact exception message would be helpful, too. Thanks.
I'm seeing this exception message coming from XslCompiledTransform.Transform(), but after handling the exception the
Should I create private static final String = Some exception message or leave it
Is there a way to filter exceptions in elma using the exception message? Examples:
I've recently updated 1 logging component to log Exception.ToString rather than Exception.Message.ToString(), the problem
I need to write the local time information , the exception message to a
What is better to use for Exception output message dynamic generation String or StringBuilder
The silverlight class library throws System.InvalidOperationException exception with ConfigFileMissing message when trying to access

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.