NSURL 개체에서 getResourceValue : forKey 메서드를 전달하여 파일 크기 특성을 가져 오려고합니다. 여기에 코드를 내가 쓰고 있습니다 :getResourceValue : forKey 메서드를 NSURL에서 사용하는 동안 오류가 발생했습니다.
NSURL *samplePath = [[NSURL alloc] initWithString:@"file://localhost/Users/Abhinav/Test/abhi.pdf"];
[samplePath getResourceValue:&name forKey:NSURLFileSizeKey error:&error];
NSLog(@"Error===%@",error);
NSLog(@"name===%@",name);
그러나 나는 다음과 같은 오류가 점점 오전 :
Error Domain=NSPOSIXErrorDomain Code=17 "The operation couldn’t be completed. File exists"
지원하시기 바랍니다. 로컬 파일의 파일 크기를 얻으려고 노력하는 경우
이것은 정말 도움이되었습니다. – Abhinav