I have the following code in my app right now. My app works, but what I really want is for playerItemDidFinishPlaying to be executed on the main thread. I guess I could just create a new method that will be called instead, and use the performSelectorOnMainThread method.
So, instead of this:
I'd have this:
So, instead of this:
Code:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerItemDidFinishPlaying:) name:AVPlayerItemDidPlayToEndTimeNotification object:nil];
I'd have this:
Code:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(someMethod) name:AVPlayerItemDidPlayToEndTimeNotification object:nil];
-(void)someMethod
{
[self performSelectorOnMainThread:@selector(playerItemDiDFinishPlaying)