简体   繁体   English

MPMoviePlayer在设备中崩溃,但在模拟器中工作正常

[英]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.

相关问题 应用程式在装置上当机,但在Simulator上运作正常 - App crashes on device, however works fine on Simulator 应用程序在模拟器上正常运行,但在设备上崩溃 - Application works fine on the simulator but crashes on the device 应用程序在模拟器上工作正常但在设备上崩溃 - application works fine on simulator but crashes on device 应用程序在模拟器上崩溃,但升级到狮子后在设备上运行正常 - App crashes on simulator but works fine in device after upgrading to lion Xamarin应用程序在设备启动时崩溃,在模拟器中运行良好 - Xamarin app crashes on startup on device, works fine in simulator UIImagePickerController在模拟器上工作,在设备上崩溃 - UIImagePickerController works on simulator, crashes on device 应用程序在模拟器上工作正常,但在设计时崩溃 - Application works fine on simulator but crashes on devise 使用XCode进行调试时,应用可以正常运行,在设备或模拟器上运行时,应用会崩溃 - When debugging with XCode, app works fine, when running it on device or simulator, app crashes UIScrollView分页在模拟器中工作正常,但是15-20页后应用程序在设备中崩溃 - UIScrollView paging works fine in simulator but application crashes in device after 15-20 pages 在iPhone模拟器中工作正常,但在iPhone设备中锁定 - Works fine in iphone simulator but lockup in an iphone device
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM