Ive been battling with a crash on my exercise app for the past couple of days when I try and play an instance of an MPMoviePlayerController in a UIView created in IB. The rest of the app runs fine, but if any MPMoviePlayer is instantiated, the debugger pauses the app without raising an exception. It's not just this code that causes it. Other methods of instantiating a moviePlayer from other posts or books cause the same result.
Its when I run this code that it drops out to the main:
NSURL *url = exercise.exerciseVideoURL;//path for vid
self.moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:url];
[self.moviePlayerController.view setFrame:self.movieHostingView.bounds];
[self.moviePlayerController prepareToPlay];
[self.moviePlayerController setControlStyle:MPMovieControlStyleNone];
[self.movieHostingView addSubview:self.moviePlayerController.view];
[[self.moviePlayerController view]
setAutoresizingMask:(UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleHeight)];
[[self.moviePlayerController view] setClipsToBounds:YES];
[[self.moviePlayerController view] setFrame:[[self movieHostingView] bounds]];
[self.movieHostingView addSubview:self.moviePlayerController.view];
self.moviePlayerController.repeatMode = MPMovieRepeatModeOne;
I've tried using MPMoviePlayer instantiating code from other posts, binning off the model and just instantiate it with a direct path like in some of the other posts, but it still drops out to main().
Got it! Ive removed "All Exceptions" from the breakpoint tab and its running fine.Why would that cause it to drop out for MPMoviePlayer?! Anyhow, Thanks to everyone who helped out.