Imagine we had a file that we’ve saved:
1 |
NSString *myFile = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/myFile.txt"]; |
Before accessing it we can determine if it exists or not:
1 |
BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:[NSHomeDirectory()stringByAppendingPathComponent:myFile]]; |