Hey all I'm using a MPMoviePlayerController and trying to catch my exception when there is no movie present.
movies = [movieDictionary objectForKey:@"movieID"];
NSLog(@"callVideoSetting");
CGRect playfram = CGRectMake(0, 0, 320, 500);
stopButton = [UIButton buttonWithType:UIButtonTypeCustom];
[stopButton setFrame:playfram];
[stopButton addTarget:self action:@selector(stopVideo:) forControlEvents:UIControlEventTouchUpInside];
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];
Now I wish to catch the exception when there is nothing behind movies.
-[NSURL initFileURLWithPath:]: nil string parameter'
I know I should have a try catch block.. But I've never handled exceptions in objective-c.