为什么在关闭presentmodalviewcontroller后pushviewcontroller不工作?
我有一个包含视频列表的应用程序。当用户单击任何视频时,将使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论