iPhone OS 3.2 - How to register for notifcations that may not be available

Posted by cdstamper on Stack Overflow See other posts from Stack Overflow or by cdstamper
Published on 2010-04-16T12:54:27Z Indexed on 2010/04/16 13:13 UTC
Read the original article Hit count: 790

So I'm trying to register for the MPMoviePlayerDidExitFullscreenNotification notification in my universal app (iPhone and iPad).

Problem is, OS 3.1.3 doesn't support this notification, and just crashes.

I've tried version checking, like so:

if ([MPMoviePlayerController instancesRespondToSelector:@selector(setShouldAutoplay:)])
{//Check for shouldSetAutoplay, this ensures that we are running at least 3.2
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerDidFinish:) name:(NSString*)class2 object:[self player]];

Doesn't work, still crashes. How do I do this?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk