У меня есть следующий код:
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:[arr objectAtIndex:0]]];
moviePlayer.shouldAutoplay = NO;
moviePlayer.useApplicationAudioSession = NO;
//create a NSNotificationCenter which call moviePlaybackComplete function when movie duration available
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieDurationAvailable:) name:MPMovieDurationAvailableNotification object:moviePlayer];
(void) movieDurationAvailable:(NSNotification *)notification
{
NSLog(@"duration of movie : %f", [moviePlayerController duration]);
}
Метод под названием movieDurationAvailable никогда не вызывается.
Скажите, пожалуйста, что я делаю неправильно?
Спасибо