Automatically change music files on next start and application crash?

I installed an array of songs to play one by one. And I call the 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 application breaks up, and the last values ​​of the log 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 am not getting the error, whatever it may be? Please help me.

+3
source share
1 answer

One question, do you access an object playerin moviePlayerPlaybackStateChangeddirect - is it a class property? Since you are sending an object with this notification, you should receive the object by extracting it from the dictionary . playersender.userInfo

0
source

All Articles