我正在使用uiimagepicker將視頻保存到我的應用程序包中。但保存之後,視頻的創建日期會發生變化。我的要求只是將該視頻複製到我的文件夾而不更改其創建的日期。使用uiimagepickercontroller保存視頻而無需更改其創建日期
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[[picker parentViewController] dismissModalViewControllerAnimated:YES];
NSURL *url = [info objectForKey:UIImagePickerControllerReferenceURL];
NSData *imageData = [NSData dataWithContentsOfURL:url];
NSString *path = NSHomeDirectory();
NSString *img_temp_name=[[NSString stringWithFormat:@"test"] stringByAppendingString:@".mov"];
NSString *full_path=[path stringByAppendingPathComponent:img_temp_name];
if([imageData writeToFile:full_path atomically:YES]) {
}
後一些代碼。 – Gypsa