Reputation: 1161
How can one check if a file exists in the documents directory by a specific name?
Upvotes: 2
Views: 1096
Reputation: 3657
BOOL result = [[NSFileManager defaultManager] fileExistsAtPath:fileLocationofDocumentDirectory]; if(result ==YES) { NSLog(@"File present"); } else { NSLog(@"File Not present"); }
Upvotes: 4
Reputation: 31722
BOOL isMyFileThere = [[NSFileManager defaultManager] fileExistsAtPath:myFilePath];
Check in NSFileManager Documentation .
Upvotes: 9