How to check file without any case sensitivity is available or not in the current fileManager path directory? In current code lower case or higher case for file name string is important.
- (BOOL) findFile{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSFileManager * fileManager = [NSFileManager new];
NSArray * subpaths = [fileManager subpathsAtPath:[paths objectAtIndex:0]];
NSString *myfilePath=nil;
if([subpaths count]!=0)
myfilePath=[subpaths objectAtIndex:0];
if([myfilePath isEqualToString:@"FileName.png"] && myfilePath!=nil){
myfilePath=[NSString stringWithFormat:@"%@/%@",[paths objectAtIndex:0],myfilePath];
return TRUE;
}
else
return FALSE;
}