Hello all quick question how can I let my app not crash when handling a nil exception
this is the code I have and it works
So how can I make sure my app doesn't crash when handling this nil exception and just do .. well nothing..
this is the code I have and it works
Code:
movies = [movieDictionary objectForKey:@"movieID"];
NSLog(@"callVideoSetting");
NSString *path = [[NSBundle mainBundle] pathForResource:movies ofType:@"m4v"];
if (!path) {
NSLog(@"exception!!");
// DO not crash my program
}
NSURL *movie = [NSURL fileURLWithPath:path];
//NSURL *movie = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:movies ofType:@"m4v"]];
//path for resource moet id worden
theMovie = [[MPMoviePlayerController alloc] initWithContentURL:movie];
[theMovie setOrientation:UIDeviceOrientationPortrait animated:NO];
theMovie.movieControlMode = MPMovieControlModeHidden;
[theMovie setScalingMode:MPMovieScalingModeAspectFit];
theMovie.backgroundColor = [ UIColor whiteColor];
So how can I make sure my app doesn't crash when handling this nil exception and just do .. well nothing..