IOS development... I have a json data file named "Data.js" in the same directory where the code file is and is trying access it with the following code...
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Data" odType:@"js"];
but this is returning null.
Any help on this is much appreciated.
The above written answers are right. By default Data.js file
will be added to the compilation phase
. You can drag that to the Copy Bundle Resources phase
. FYI i'am adding a reference screen shot. Go to the settings page of your target under Build phases
you can find these sections. Drag the selected file to Copy Bundle Resources phase