我正在捕獲視頻剪輯,但我試圖將該文件保存到應用程序文檔目錄。我得到以下不兼容的指針類型nsurl到nsstring
不兼容的指針類型發送 'NSURL' 到類型的參數 '的NSString *'
在videoURL與NSData的線?
int timestamp = [[NSDate date] timeIntervalSince1970];
NSURL *videoURL = _movieURL;
NSData *videoData = [NSData dataWithContentsOfFile: videoURL];
NSString *videoString = [NSString stringWithFormat:@"%d.MOV", timestamp];
NSString *videoPath = [documentsPath stringByAppendingPathComponent: videoString]; //Add the file name
[videoData writeToFile:videoPath atomically:NO];
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
self.movieURL = info[UIImagePickerControllerMediaURL];
// NSLOg("MOVIE URL: %@", _movieURL);
[picker dismissViewControllerAnimated:YES completion:NULL];
}
什麼是時間戳......無論是其文件位置字符串或其他? – svmrajesh
[dataWithContentsOfFile:](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSData_Class/Reference/Reference.html#//apple_ref/occ/clm/NSData/dataWithContentsOfFile: )需要一個NSString – pNre