Created
January 26, 2013 08:46
-
-
Save kasajei/4641114 to your computer and use it in GitHub Desktop.
【cocos2d-x】CCDictionaryの中身をすべて取り出す ref: http://qiita.com/items/0f74b5850debb3333443
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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