在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];

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

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...