[英]MPMoviePlayer crashes in device but works fine in simulator
In my app i am playing a video using the following code. 在我的应用程序中,我正在使用以下代码播放视频。
NSURL *myURL = [[NSURL alloc] initWithString:downloadURL];
mMoviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:myURL];
if (mMoviePlayer) {
[self initMoviePlayer];
[mMoviePlayer play];
}
This code is working fine in simulator, but when i test it in device it is giving "BAD_ACCESS" error. 该代码在模拟器中工作正常,但是当我在设备中对其进行测试时,它给出“ BAD_ACCESS”错误。 Device is not at all sending the request to video.
设备根本没有将请求发送到视频。
Can some one help me with this.. 有人可以帮我弄这个吗..
Thanks... 谢谢...
There's nothing wrong with this code. 这段代码没有错。 The bug is somewhere else.
该错误在其他地方。
BAD_ACCESS
generally points to memory management issues: you're trying to access an object that has been deallocated. BAD_ACCESS
通常指向内存管理问题:您正在尝试访问已释放的对象。 If you're sure that the crash is happening on the above line, double check that safeURL
exists at that point. 如果您确定崩溃发生在上述行中,请仔细检查
safeURL
存在safeURL
。 If it does, you're going to have to post more code for us to give you any pointers. 如果确实如此,则您将不得不发布更多代码,以便我们为您提供任何指针。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.