该解决方案对我有用..
您不想提供路径的整个部分,例如/Users/krunal/Library/Application Support/iPhone Simulator/5.0/Applications/D414BC19-C005-4D93-896D-A6FB71DE4D21/Documents/衍生品
您必须提供Derivatives/Myfile.epub (FolderName/filename) 以检查文件路径
NSFileManager *filemanager=[NSFileManager defaultManager];
NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory= [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"Derivatives/Myfile.epub"];
BOOL success =[filemanager fileExistsAtPath:path];
if (success == YES) {
NSLog(@"exists");
}
else {
NSLog(@"not exists");
}