在iOS7中无法显示模态ViewController

我试图将系统定义的视图控制器(MFMailComposeViewController,TWTweetComposeViewController等)显示为模态视图.

但是这些控制器不会出现在iOS 7中(这些在iOS5,iOS6中运行).

我创建的Viewcontrollers出现在iOS7(ex.HogeViewController)中.

我不调用presentViewController:动画:在viewDidLoad完成或viewWillAppear.

有人有想法吗?

控制台日志:

init Error Domain=NSCocoaErrorDomain Code=4097 “The operation couldn’t be completed. (Cocoa error 4097.)”

要么

_serviceViewControllerReady:error: Error Domain=NSCocoaErrorDomain Code=4097 “The operation couldn’t be completed. (Cocoa error 4097.)”

要么

Unbalanced calls to begin/end appearance transitions for .

TWTweetComposeViewController(不显示)

TWTweetComposeViewController *viewController = [[TWTweetComposeViewController alloc]init];
viewController.completionHandler = ^(TWTweetComposeViewControllerResult result){
    NSLog(@"Result : %d",result);
};
[self presentViewController:viewController animated:YES completion:NULL];

日志

Result : 0

MFMailComposeViewController(出现一会儿,很快就会关闭)

- (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);
    }];
}

日志

_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

解决方法

结果是在自定义UIBarButtons时才出现问题.如果我们在iPhone 5s上运行的32位应用程序中使用以下内容,我们有问题:
[[UIBarButtonItem appearance] setTitlePositionAdjustment:UIOffsetMake(0,1.0)
                                           forBarMetrics:UIBarMetricsDefault];

离开这条线可以解决问题.我们已经提出了一个雷达.

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...