MPMoviePlayerViewController 在 OS 3.0 上崩溃

发布于 2024-09-08 18:45:35 字数 831 浏览 2 评论 0原文

在测试我的应用程序期间,我发现它在 OS 3.0.1 和 3.1.1(iPod Touch) 的 iPhone 上崩溃。

我有以下代码用于播放放置在远程服务器上的视频。它可以在 iOS 4.0 和 OS 3.2 的 iPad 上完美运行。

Xcode 设置为使用 SDK 4.0,但目标操作系统是 3.0。

NSURL *url = [NSURL  URLWithString:selectedLink];  
MPMoviePlayerViewController *moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:url]; 
[self presentMoviePlayerViewControllerAnimated:moviePlayer];
[moviePlayer release];

在 3.0.1 和 3.1.1 上运行时,我收到以下错误:

-[UIViewController presentMoviePlayerViewControllerAnimated:]: unrecognized selector sent to instance 0x231550
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:  -[UIViewController presentMoviePlayerViewControllerAnimated:]: unrecognized selector sent to instance 0x231550'

希望你们能帮助我。

During the testing of my app i discovered that it crashed on an iphone with OS 3.0.1 and 3.1.1(iPod Touch).

I have the following code for playing the video which is placed on a remote server. It works flawlessly on the iOS 4.0 and iPad with OS 3.2

Xcode is setup to use SDK 4.0 but target OS is 3.0.

NSURL *url = [NSURL  URLWithString:selectedLink];  
MPMoviePlayerViewController *moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:url]; 
[self presentMoviePlayerViewControllerAnimated:moviePlayer];
[moviePlayer release];

When run on 3.0.1 and 3.1.1 I receive the following error:

-[UIViewController presentMoviePlayerViewControllerAnimated:]: unrecognized selector sent to instance 0x231550
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:  -[UIViewController presentMoviePlayerViewControllerAnimated:]: unrecognized selector sent to instance 0x231550'

Hope you guys can help me.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

玩心态 2024-09-15 18:45:35

MPMoviePlayerViewController 最近已添加,可在 iPhone OS 3.2 及更高版本中使用。

您应该使用 MPMoviePlayerController。

MPMoviePlayerViewController has been added recently and is available in iPhone OS 3.2 and later.

You should use MPMoviePlayerController.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文