I have been working on a project where I added a file into the app bundle. I didn't relise that the project already included the same name file but with a small difference. The difference is the first letter in name in upper/lower case. I wanted to know how the foundation framework classes load resources in such a case.
Here is a test:
NSString *pathentities = [[NSBundle mainBundle] pathForResource:@"entities" ofType:@"json"];
NSString *pathEntities = [[NSBundle mainBundle] pathForResource:@"Entities" ofType:@"json"];
NSError *error = nil;
NSString *entities = [NSString stringWithContentsOfFile:pathentities encoding:NSUTF8StringEncoding error:&error];
NSString *Entities = [NSString stringWithContentsOfFile:pathEntities encoding:NSUTF8StringEncoding error:&error];
NSLog(@"entities : %@ , Entities : %@", entities, Entities);
Entities.json file content: "Entities" entities.json file content: "entities"
NSLog output:
entities : Entities, Entities : (null)