MPMoviePlayerViewController 在 OS 3.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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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.