rapidjson::Document document;
document.SetObject();
rapidjson::Document::AllocatorType& allocator = document.GetAllocator();
int key = 10;
int color = 3;
const char* s_key = cocos2d::String::createWithFormat("%d", key)->getCString();
rapidjson::Value genKey(s_key, allocator);
document.AddMember(genKey, color, allocator);
```
上面这段代码在win32的版本上运行没有一点问题。我看了保存的json字符串
但一到android上的release版本就报错。
而且奇怪的是debug版本就没有问题。。!!!
搞了两天都没有搞明白。。。
有没有高手能指教一下不?
cocos2dx3.9 有安装cocosframework
哎,最终选择。自己用字符串拼成json格式。。。
看起来好像就是内存的问题;由于手机内存小,s_key的内存被释放然后被其他占用了;调用时候就指向其他位置;电脑内存大没有这个问题。