2012-04-18 10 views
3

私は曲の配列を1つずつ再生するように設定しました。そして、私は以下の方法 を呼び出します。音楽ファイルを変更すると自動的にエラーが発生し、アプリケーションがクラッシュしますか?

[[NSNotificationCenter defaultCenter] addObserver:self 
              selector:@selector(moviePlayerPlaybackStateChanged:) 
               name:MPMoviePlayerPlaybackStateDidChangeNotification 
               object:player]; 

-(void) moviePlayerPlaybackStateChanged:(NSNotification*) sender 
{ 
    NSLog(@"in state changed = %d and isPause = %d", player.playbackState, isPause); 
    if (player.playbackState == MPMoviePlaybackStatePlaying) { 
     [activityIndicator stopAnimating]; 
    } 

    if (player.playbackState == MPMoviePlaybackStateInterrupted) { 
     isPause =YES; 
    } 
} 

アプリがクラッシュします5つのまたは6曲を演奏し、次のように最後のログ値は次のとおりです。

2012-04-18 15:54:45.026 SymphonyProject[2896:207] in state changed = 1 and isPause = 0 
2012-04-18 15:54:45.027 SymphonyProject[2896:207] in state changed = 2 and isPause = 0 
[Switching to process 2896 thread 0x603b] 
[Switching to process 2896 thread 0x603b] 
sharedlibrary apply-load-rules all 

and go to the file objc_mesgSend and pointing the line: 
0x0164a09b <+0015> mov 0x8(%edx),%edi 

私はそれが何であれ、エラーを取得していないメートル?私を助けてください。

答えて

0

1つの質問playerのオブジェクトmoviePlayerPlaybackStateChangedに直接アクセスしていますか?この通知でオブジ​​ェクトを送信するので、playerオブジェクトをsender.userInfo辞書から取得して取得する必要があります。

関連する問題