I am trying to fetch the file size attribute from a NSURL object by passing it getResourceValue:forKey method. Here is the code i am writing:
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);
But i am getting following error:
Error Domain=NSPOSIXErrorDomain Code=17 "The operation couldn’t be completed. File exists"
Please assist.