0

我可以使用弹出框控制器返回页面视图控制器中的先前视图控制器吗?有什么方法可以做到这一点。

我正在尝试此代码。

-(void)goNext
{
Vcontr = [self.pageController.viewControllers objectAtIndex:0];

UIPopoverController *popoverController = [[UIPopoverController alloc] initWithContentViewController:pageController];

if(popoverController == nil){   //make sure popover isn't displayed more than once in the view
    popoverController = [[UIPopoverController alloc] initWithContentViewController:pageController];
}
[popoverController presentPopoverFromRect:self.view.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

popoverController.delegate = self;

 }
4

2 回答 2

0

这里有一些教程:

iPad for iPhone Developers 101:UIPopoverController 教程

iPad UIPopoverController 视频

并阅读Apple 开发人员

你可以找到苹果开发者的示例代码

于 2012-12-12T11:26:40.220 回答
0
 UIPopoverController *popoverController ;///defin this in the .h

if(popoverController == nil){   //make sure popover isn't displayed more than once in the view
    popoverController = [[UIPopoverController alloc] initWithContentViewController:yourPageViewController]; 
}
[popoverController presentPopoverFromRect:self.view.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

popoverController.delegate = self;
}
于 2012-12-12T11:32:10.143 回答