Check if a file exists in the documents directory
How can one check if开发者_JAVA技巧 a file exists in the documents directory by a specific name?
BOOL isMyFileThere = [[NSFileManager defaultManager] fileExistsAtPath:myFilePath];
Check in NSFileManager Documentation .
-[NSFileManager fileExistsAtPath:]
BOOL result = [[NSFileManager defaultManager] fileExistsAtPath:fileLocationofDocumentDirectory]; if(result ==YES) { NSLog(@"File present"); } else { NSLog(@"File Not present"); }
精彩评论