【发布时间】:2011-02-13 23:45:51
【问题描述】:
我设置了一个 MFMailComposeViewController,它在 iPhone 上工作得很好,但在 iPad 上它崩溃了,说:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target...
那么为什么这会创建一个 nil 模态视图呢?
MFMailComposeViewController *message = [[MFMailComposeViewController alloc] init];
[message setMessageBody:@"My message here" isHTML:NO];
[message setToRecipients:[NSArray arrayWithObject:@"my@domain.com"]];
[message setSubject:@"Request Info"];
message.mailComposeDelegate = self;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
message.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:message animated:YES];
[message release];
有什么想法吗?
【问题讨论】:
标签: ipad mfmailcomposeviewcontroller