3

I have set the songs array to play one by one.And I call a method described below.

[[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;
    }
}

playing 5 or 6 songs the app get crashed and last log values are as follows:

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

I m not getting the error whatever it is? Please help me.

4

1 回答 1

0

一个问题,您直接访问player对象moviePlayerPlaybackStateChanged- 它是类属性吗?因为您使用此通知发送对象,所以您应该player通过从sender.userInfo字典中检索对象来获取该对象。

于 2012-08-04T00:41:15.180 回答