呈现模态视图控制器 (MPMoviePlayerViewController) 时出现问题
我的应用程序启动,并且我有一个 UITabBarController。在第一个选项卡上,我有一个 UIViewController 的子类。正是在这个类中,我拥有了电影播放功能。我不知道为什么,但是从这个类中,我无法presentModalViewController或presentMoviePlayerViewControllerAnimated。不过,我可以将视图添加为子视图。我找到了这篇文章,这本质上就是我想要做的(呈现一个电影播放器视图控制器):如何从 UITabBarController 呈现 MPMoviePlayerViewController?
但即使保留对 UITabBarController 的引用对我来说也不起作用。我不太确定为什么这个类在呈现模态视图控制器时存在问题,而在其他选项卡中,我能够做到。有什么想法吗?谢谢。
My App starts up, and I have a UITabBarController. On the first tab I have a subclass of UIViewController. It's in this class that I have my movie playing functionality. I do not know why, but from this class, I cannot presentModalViewController or presentMoviePlayerViewControllerAnimated. I can however add views as a subView. I found this post, which is essentially what I'm trying to do (present a movie player view controller): How to present MPMoviePlayerViewController from a UITabBarController?
But even keeping a reference to the UITabBarController does not work for me. I'm not really sure why this class has problems presenting a modal view controller, versus in other tabs, I am able to. Any thoughts? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过更多查看,我发现问题是我无法在 viewDidLoad 方法中以模态方式呈现视图。
After more looking, I found that the problem is I cannot present a view modally within the viewDidLoad method.