当我编写下面提到的代码时出现此错误。基本上我想将 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"); } } }