I have a JSON resource resource.json in my /MyApp/Resources/ folder. I want this resource localized so I have chosen in Xcode to localize it for swedish and english. I now have 2 folders:
/MyApp/Resources/sv.lproj/resource.json
And
/MyApp/Resources/en.lproj/resource.json
So far so good. But whenever I try to use this resource with:
NSString *jsonPath = [[NSBundle mainBundle] pathForResource:@"resource" ofType:@"json"];
NSString *jsonString = [NSString stringWithContentsOfFile:jsonPath encoding:NSUTF8StringEncoding error:&error];
jsonString will always contain the english version of the resource. I have tried switching languages in both simulator and on device to no avail.
I’m not sure how to troubleshoot this…
After deletion of the app, clean and build it worked.