views:

133

answers:

1

In iPhone 3.1 I used the following code to play a movie:

moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
moviePlayer.movieControlMode = MPMovieControlModeDefault;
moviePlayer.backgroundColor = [UIColor blackColor];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playbackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer];  
[moviePlayer play]; 

For some reason this does not work anymore in iPhone 4.0 (go Apple!). How should I play a movie in iPhone 4.0 while retaining backward-compatibility with iPhone 3.1?

A: 

check this link for nice tutorial
http://cocoabugs.blogspot.com/2010/08/troubleshoting-iphone.html

jeeva