iphonejsonnsbundle

.json file not included in mainBundle?


I'm creating an iPhone app that includes .json files in the resource, but those files couldn't be accessed using:

[[NSBundle mainBundle] pathForResource:@"xxx" ofType:@"json"]  

It seems that these files aren't included in the built app-package. Is there something i have to configure to include .json files in the package?

Thanks


Solution

  • Nothing to do, just checking it has been added in the target (the small tick on the right in the picture). And then check the build details logs to verify it has been effectively copied.

    json file added as resource