views:

121

answers:

1

If I use MPMoviePlayerViewController in 3.2/4.0 it builds fine.

If I use it in 3.1.3 and below the build fails with error

Expected specifier-qualifier-list before MPMoviePlayerViewController'

I use this class in 113 places, so I get 113 errors.

What is the best way to fix this critical issue?

A: 

Hi there, I was dealing with exactly the same problem as you. unfortunately, if you want it work well there's no way around "double-coding" your moviePlayer related ViewControllers.

so within your implementation for 3.0 you will have to use MPMoviePlayerController (which has certain limitations, compared to the newer MPMoviePlayerViewController implementation) .

cheers,
sam

samsam
So Are you saying I essentially need two separate builds?One for 3.2 and above and the other for 3.1.3 and below? As in I actually have to submit the app twice?
David van Dugteren
no, no you got me wrong on that. what you have to do is implement ONLY your MoviePlaying-ViewControllers twice, then you have for example your MoviePlaybackViewController3 and MoviePlaybackViewController4 the first one using MPMoviePlayerController the latter one using MPMoviePlayerViewController... then within your App differentiate between the OS the app is currently running on hence load/display the version of your MoviePlaybackViewController.
samsam
From various threads and procrasination I've discovered the only known way to do it is to use the practice:Class classToCheck = (NSClassFromString(@"MPMoviePlayerViewController"));if (classToCheck != nil ){ Use new SDK Code}else{ Use the old SDK code.}
David van Dugteren