dataWithContentsOfURL报错问题

时间:2024-11-20 13:07:31
 NSError *error = nil;
NSData* videoData = [NSData dataWithContentsOfURL:[NSURL URLWithString:self.recordFilePath] options: error:&error];
if (nil == videoData || videoData.length <= )
{
videoData = [NSData dataWithContentsOfFile:self.recordFilePath options: error:&error];
}
if (videoData.length <= )
{
return;
}

第一个if之前的代码会报错,
(lldb) po error Error Domain=NSCocoaErrorDomain Code=256 "未能完成操作。(“Cocoa”错误 256。)" UserInfo=0x174666740 {NSURL=/var/mobile/Containers/Data/Application/FBF2584C-7428-4709-A2F2-80CBD91B6A40/Documents/1.mp4}

百思不得姐,换用第二个OK了
留待来日在做处理吧