This function uses map::insert to insert the given object in the dictionary. However, if an object with that key already exists, insert will have no effect. So for example, the following assert will fire:
CCString s1 = new CCString;
CCStrings2 = new CCString(“string2”);
I would have thought that setObject should always have an effect. In this case, it will have no effect on the second call. I would have expected the object to have been set, both times, but the second time it isn’t. I believe the cocoa class NSMutableDictionary would not have fired the assert in my snippet there, and isn’t it supposed to have the same behaviour as CCMutableDictionary?