plist:
<?xml version="1.0" encoding="UTF-8"?> id 1 map Tiled/1.tmx id 2 map Tiled/2.tmx代码:
//读取关卡
int stage = 1;// GameManager::sharedAppContext()->getStage();
Array* arr = Array::createWithContentsOfFile(“Tiled/Map.plist”);
CC_SAFE_RETAIN(arr);
Dictionary* dic = (Dictionary*)arr->objectAtIndex(stage - 1);
String* str = (String*)dic->objectForKey("map");
走到createWithContentsOfFile时断了,
错误出在CCValue.cpp的:
std::string Value::asString() const
{
CCASSERT(_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP, “Only base type (bool, string, float, double, int) could be converted”);
看了一下,arr的值里面都是乱码,搞不懂了,请大神指教。。。