为什么在关闭presentmodalviewcontroller后pushviewcontroller不工作?

发布于 2024-11-17 17:00:54 字数 816 浏览 3 评论 0原文

我有一个包含视频列表的应用程序。当用户单击任何视频时,将使用 mpmovieplayercontroller 在全屏模式和横向模式下播放视频。moviewplayer 控制器中包含 donatenow 按钮。当用户单击该按钮时,应打开捐赠表单。为此,我正在编写以下代码

-(void)donate:(id)sender { [自我解雇ModalViewControllerAnimated:是];
//[selfpresentModalViewController:moviePlayeranimated:YES];

NSLog(@"Donation form method called");

DonationForm *dfvc=[[DonationForm alloc]initWithNibName:@"DonationForm" bundle:nil];
//[self presentModalViewController:dfvc animated:YES];
[self.navigationController pushViewController:dfvc animated:YES];
[dfvc release];

} 有了这个 mpmoviecontroller 就被删除了。但它并没有将视图推送到捐赠表单。 我怎样才能做到这一点?

更新:通过在 appDelegate 中声明 UIViewController *viewController 并在上面的方法中使用它作为 [appDelegate.viewControoller.navigationController PushViewController:dfvcAnimated:YES] 解决了这个问题;

I have one application that has list of videos.When user clicks any of videos the video is played using mpmovieplayercontroller in full screen mode and landscape mode.moviewplayer controller contains donatenow button in it.When user clicks that button then donation form should be opened.For that i am writing the following code

-(void)donate:(id)sender
{
[self dismissModalViewControllerAnimated:YES];
//[self presentModalViewController:moviePlayer animated:YES];

NSLog(@"Donation form method called");

DonationForm *dfvc=[[DonationForm alloc]initWithNibName:@"DonationForm" bundle:nil];
//[self presentModalViewController:dfvc animated:YES];
[self.navigationController pushViewController:dfvc animated:YES];
[dfvc release];

}
with this mpmoviecontroller is removed.But it is not pushing the view to the donation form.
how can i do that?

UPDATE:The issue got solved by declaring the UIViewController *viewController in appDelegate and using it in above method as [appDelegate.viewControoller.navigationController pushViewController:dfvc animated:YES];

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文