下記のコードを書いたときにこのエラーが発生しました。基本的に、UIImagePickerControllerによってキャプチャされたビデオをアプリディレクトリに保存したいのですが、間違えた場所がわかりません。助けてください。
- (void) imagePickerController: (UIImagePickerController *) picker didFinishPickingMediaWithInfo: (NSDictionary *) info { NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType]; [self dismissModalViewControllerAnimated:NO]; // Handle a movie capture if (CFStringCompare ((__bridge_retained CFStringRef) mediaType, kUTTypeMovie, 0) == kCFCompareEqualTo) { NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDir = [documentPaths objectAtIndex:0]; NSString *movieName = [NSString stringWithFormat:@"%@.mov",[self getNameForVideo]]; NSString *moviePath = [documentsDir stringByAppendingPathComponent:movieName]; NSURL * movieURL = [info valueForKey:UIImagePickerControllerMediaURL]; NSData * movieData = [NSData dataWithContentsOfURL:movieURL]; if([movieData writeToFile:moviePath atomically:NO]) { [self saveVideoInfoInDatabase]; } else { NSLog(@"Video could not be saved to the document directry"); } } }