I am trying that with the following native code but i get errors in the binding:
string path = CCFileUtils::sharedFileUtils()->getWritablePath();
CCLOG ("saveFile, path = %s", path.c_str());
CCLOG ("this is the reported size: %f", size);
FILE *fp = fopen(path.c_str(), “wb”);
if (! fp)
CCLOG ("can not create file %s", path.c_str());
double result = fwrite(&file, size, 1, fp);
if (result == size)
CCLOG ("write these bytes %f", result);
CCLOG ("error in the write of these bytes %f", result);
Can I please have a look at your native code. Error occurs when trying to convert JSvalue to CCArray. The file data is represented like that ln JS.
hammer lava wrote:
I wrote them in the native code and binding the function to js.