2
目前,我正在開發中,我已保存錄制的視頻記錄的目錄和我如何獲得NSdocument目錄保存的視頻
代碼是在這裏的應用程序:
NSURL * movieURL = [info valueForKey:UIImagePickerControllerMediaURL] ;
NSData * movieData = [NSData dataWithContentsOfURL:movieURL];
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [documentPaths objectAtIndex:0];
NSString *fullPath = [documentsDirectory stringByAppendingPathComponent:[[self video]text]];
fullPath = [fullPath stringByAppendingFormat:@".MOV"];
[movieData writeToFile:fullPath atomically:YES];
現在我該怎麼檢查視頻是否保存在文檔目錄中?
或BOOL成功; NSFileManager * fileManager = [NSFileManager defaultManager];成功= [fileManager fileExistsAtPath:fullPath]; if(success){NSLog(@「file already exists」);} –