Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot show modal ViewController in iOS7
    text
    copied!<p>I tried to show system defined viewcontrollers (MFMailComposeViewController, TWTweetComposeViewController,etc..) as a modal view.</p> <p>But these viewcontrollers dosn't appear in iOS 7(these run in iOS5,iOS6).</p> <p>Viewcontrollers created by me appear in iOS7(ex.HogeViewController). </p> <p>I don't call <code>presentViewController:animated:completion</code> at <code>viewDidLoad</code> or <code>viewWillAppear</code>.</p> <p>Does anybody have an idea?</p> <p>Console logs:</p> <blockquote> <p>init Error Domain=NSCocoaErrorDomain Code=4097 "The operation couldn’t be completed. (Cocoa error 4097.)"</p> </blockquote> <p>or</p> <blockquote> <p>_serviceViewControllerReady:error: Error Domain=NSCocoaErrorDomain Code=4097 "The operation couldn’t be completed. (Cocoa error 4097.)"</p> </blockquote> <p>or</p> <blockquote> <p>Unbalanced calls to begin/end appearance transitions for .</p> </blockquote> <p>TWTweetComposeViewController(doesn't appear)</p> <pre><code>TWTweetComposeViewController *viewController = [[TWTweetComposeViewController alloc]init]; viewController.completionHandler = ^(TWTweetComposeViewControllerResult result){ NSLog(@"Result : %d",result); }; [self presentViewController:viewController animated:YES completion:NULL]; </code></pre> <p>Log</p> <blockquote> <p>Result : 0</p> </blockquote> <p>MFMailComposeViewController(appears a moment and dismiss soon)</p> <pre><code>- (void)send:(NSString*)email{ if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; NSArray *toRecipients = @[email]; [picker setToRecipients:toRecipients]; [picker setSubject:@"Subject"]; [picker setMessageBody:@"Body" isHTML:NO]; [self.navigationController presentViewController:picker animated:YES completion:NULL]; } } - (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { [self dismissViewControllerAnimated:YES completion:^{ NSLog(@"error:%@,result:%d",error.description,result); }]; } </code></pre> <p>Log</p> <blockquote> <p>_serviceViewControllerReady:error: Error Domain=NSCocoaErrorDomain Code=4097 "The operation couldn’t be completed. (Cocoa error 4097.)" Unbalanced calls to begin/end appearance transitions for . error:(null),result:0</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload