CCLog!

%x是指以16进制数输出
%o是指以8进制数输出
u%是按无符号输出
%c指以字符形式输出

 

 

打印字典元素
CCLOG("pDict_2:%s",((CCString*)pDict_2->valueForKey("special_1"))->getCString()); 

//-------------------------------------------------------------------------------------------------------------------------------------------------------

打印数组元素
CCArray* pArray = new CCArray(); 

        pArray = pDict->allKeys();//把所有的键值付给pArray  

        for (int i = 0;i < pArray->count();i++) 

        { 

            CCLOG("pArray%i:%s",i+1,((CCString*)pArray->objectAtIndex(i))->getCString()); 

        } 

//-------------------------------------------------------------------------------------------------------------------------------------------------------

将整型作为CCString输出
CCLog("%s", CCString::stringWithFormat("%d", 2)->getCString());

//-------------------------------------------------------------------------------------------------------------------------------------------------------

std::string mapName;
CCLOG("[%s]",mapName.c_str());

posted @ 2013-05-28 17:56  六界剑仙  阅读(228)  评论(0)    收藏  举报