cocos2d-xでモデルまわりをどうしようかなぁと。
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() );
}
んーん、CCARRAY_FOREACH
便利だけど、変数がなぁ。。。