Skip to content

Instantly share code, notes, and snippets.

@kasajei
Created January 26, 2013 08:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kasajei/4641114 to your computer and use it in GitHub Desktop.
Save kasajei/4641114 to your computer and use it in GitHub Desktop.
【cocos2d-x】CCDictionaryの中身をすべて取り出す ref: http://qiita.com/items/0f74b5850debb3333443
CCDictionary *dictionary = CCDictionary::create();
dictionary->setObject(CCString::create("testObject1"),"testKey1");
dictionary->setObject(CCString::create("testObject2"),"testKey2");
CCArray *keys = dictionary->allKeys();
CCObject *key;
CCARRAY_FOREACH(keys, key){
CCString *keyString = (CCString *)key;
CCLOG("key -> %s" , keyString -> getCString() );
CCString *objectString = (CCString *)dictionary -> objectForKey(keyString->getCString());
CCLOG("object -> %s", objectString -> getCString() );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment