异常消息:
Objective-C exception thrown. Name: NSInvalidArgumentException Reason:
Application tried to present a nil modal view controller on target <Navigator: 0x1bed0d0>.
这是我的代码:
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);
});
}
它适用于 iPad 模拟器,但不适用于设备。