resource loading problem on ios

Hello,

I m trying to load a lua file from resource folder on ios

everything runs fine on windows , but on ios (ipad and ipad simulator) , the file can’t be found, any ideas why ?

I added the file to the resource folder , tried at root or in a “lua/” folder and the problem is the same.

If I browse the resource folder on the simulator I can see the file.

the problem only occurs on this lua file (the file lua file I added to the project actually) , we dont have any issue with other resource (images/audio file)

I just tried to move HelloLua/Resource/hello.lua into HelloLua/Resource/lua/hello.lua, it runs successfully.

Please make sure that, when you add this lua file & folder into xcode, select “Create folder references for any added folders” instead of the default value “Create groups for any added folder”, and then the “lua” folder in xcode shows in blue instead of yellow.

At last, modify this line to make the demo to run

#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
    string path = CCFileUtils::fullPathFromRelativePath("lua/hello.lua");
    CCScriptEngineManager::sharedScriptEngineManager()->getScriptEngine()->executeScriptFile(path.c_str());
#endif 

problem fixed by adding

 string path = CCFileUtils::fullPathFromRelativePath( my_path);

thanks :slight_smile: