CCDictionary* dict=CCDictionary::create(); CCString* str1=CCString::create("123"); CCString* str2=CCString::create("456"); dict->setObject(str1,"key1"); dict->setObject(str2,"key2"); CCString* tempStr=(CCString *)dict->objectForKey("key2"); CCLOG("%s",tempStr->getCString());
CCDictionary就是一个map