0

タイトル/スプラッシュ画面用の小さなムービーを読み込もうとしています。ただし、呼び出してpresentMoviePlayerViewControllerAnimatedも何も起こりません。コードのブロックが実行されていることを確認しましたが、ユーザーが認識できるものは何もありません。

iPad を対象としているため、3.2 を想定しています。

どんな助けでも大歓迎です。

- (void)viewDidLoad {
  [super viewDidLoad];

  NSString *path = [[NSBundle mainBundle] pathForResource:@"Intro" ofType:@"m4v" inDirectory:nil];
  NSURL *fileURL = [NSURL fileURLWithPath:path];
  MPMoviePlayerViewController *playerView = [[MPMoviePlayerViewController alloc] initWithContentURL:fileURL];
  [[NSNotificationCenter defaultCenter] addObserver:self selector: @selector(playbackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:playerView.moviePlayer];
  [self presentMoviePlayerViewControllerAnimated:playerView];
  [playerView release];
}

- (void)playbackDidFinish:(NSNotification*)aNotification {
  MPMoviePlayerController *player = [aNotification object];
  [[NSNotificationCenter defaultCenter] removeObserver:self
                                                name:MPMoviePlayerPlaybackDidFinishNotification
                                              object:player];
  [player stop];
  [self dismissMoviePlayerViewControllerAnimated];
}
4

1 に答える 1

1

[playerViewrelease]という行を配置する必要があります。この行の後[selfdismissMoviePlayerViewControllerAnimated];

于 2011-02-15T20:17:54.503 に答える