I'm have the following code:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerWillEnterFullscreen:)
name:MPMoviePlayerWillEnterFullscreenNotification
object:nil];
And the method uses a property of self:
- (void)moviePlayerWillEnterFullscreen:(NSNotification *)notification
{
NSLog(@"%@", self.videoItem._id);
}
Sometimes (not always) the self object inside the handler is a different object (and an uninitialized one which causes a crash)
I can't seem to figure out what am I doing wrong, and how to avoid this case.
Is the "self"
object gets copied?