直到昨天,我的 MPMovieController 在iPhone SDK 3中运行良好。但是昨天当我升级 SDK ti iphone SDK 4时,我的电影播放器停止工作,它在下一行给了我一个弃用警告(他们已经弃用了很多方法)
moviePlayer.movieControlMode = MPMovieControlModeDefault;
我的完整代码如下:
NSURL *fileURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/videos/%@",[[NSUserDefaults standardUserDefaults] objectForKey:@"SERVICE_URL"]
,customObject.movieURL]];
MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];
if (mp)
{
// save the movie player object
self.moviePlayer = mp;
moviePlayer.movieControlMode = MPMovieControlModeDefault;
[mp release];
// Apply the user specified settings to the movie player object
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(myMovieFinishedCallback:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];
// Play the movie!
[self.moviePlayer play];
}
请告诉我要替换哪种方法而不是不推荐使用的方法或者应该做一些不同的事情?
谢谢 ,