I integrate cocos2d-js into my native iOS application.
At some point, I have a Javascript function inside my ios application with the following code:
var txt = jsb.fileUtils.getStringFromFile("project.json");
But my project.json is in the Document folder, not in my package. Therefore, I need to get my document folder path in this Javascript file to have something like this:
var myPath = SomeFunctionToGetPath(); var txt = jsb.fileUtils.getStringFromFile("myPath/project.json");
Anyone with an idea how I should implement SomeFunctionToGetPath ?
Thank you for your help.
source share