应用程序尝试以模态方式呈现活动控制器

时间:2015-03-22 16:05:32

标签: ios ios8

我有两个UIViewControllers并将它们放在UISlpitViewController

enter image description here

将ipad转到垂直方向时,它会变为

enter image description here

我希望当我触摸箭头时可以弹出viewController1'<'

enter image description here

-(void) popOverViewController2 ;
{
    UIPopoverController *popover=[[UIPopoverController alloc] initWithContentViewController:viewController2]; 

    popover.delegate=self;

    [popover presentPopoverFromBarButtonItem:viewController2.listBackBarItem
                    permittedArrowDirections:UIPopoverArrowDirectionAny animated:true ];



}

上面的代码适用于以前的iOS,但它在iOS8上报告错误

Terminating app due to uncaught exception 
'NSInvalidArgumentException', reason: 'Application tried 
 to present modally an active controller <ViewController2: 0x79ecdf60>.'

您的评论欢迎

0 个答案:

没有答案