Anthony Main
Anthony Main

Reputation: 6068

Setting MPMoviePlayer controlStyle to MPMovieControlStyleNone crashes app

I have an app which uses a manager to offer up the relevant custom view for a selected item when selected.

The selection is done through one of 3 parent custom views

One of the custom views displays a view with an embedded MPMovieControl on it.

This works fine however for some reason in the Gallery view if I have set the controlStyle of the video set to MPControlStyleNone the app crashes, well it locks up the simulator and Xcodes debugger doesnt even notice, just assumes its still running.

This line is the culprit

player.controlStyle = MPMovieControlStyleNone;

Without it, it works fine, but then I obviously have the unrequired controls displayed

Upvotes: 1

Views: 2008

Answers (3)

Nungster
Nungster

Reputation: 726

Run the program using the profiler and check for NSZombies. Most likely the app is crashing due to a wrong release count or an autorelease and the symptom is your movie crashing when it might be something related to you starting the movie and needing it later to find it was released.

Upvotes: 0

Kirby Todd
Kirby Todd

Reputation: 11546

iOS 2.0 through iOS 3.1 uses movieControlMode. Everything newer uses controlStyle. Test for newer and fall back to older.

   if ([movie respondsToSelector:@selector(setControlStyle:)]) {
        movie.controlStyle = MPMovieControlStyleNone;
    } else {
        movie.movieControlMode = MPMovieControlModeHidden;
    }

Upvotes: 4

Umair A.
Umair A.

Reputation: 6863

May be this will work.

[player setControlStyle:MPMovieControlStyleNone];

Upvotes: 0

Related Questions