的行为Dictionary
让我感到困惑:我有一个Dictionary
,填充如下:
var playerControllers:Dictionary = new Dictionary();
playerControllers[id] = new PlayerController();
然后,我正在删除我的一个控制器:
delete playerControllers[id]; //I also tried playerControllers[id] = null;
然后:
for each (var playerController:PlayerController in playerControllers)
{
//"deleted" PlayerController exists!
}
如何使用字典中的键删除值?