MFMailComposeViewController - iPad

Я установил 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];

Есть идеи?

30
задан RyanJM 13 February 2011 в 23:45
поделиться