Why does delete( DictionaryInstance[ key ] ); fail?
问题 My app uses a Dictionary protected _categoryToValueDict:Dictionary = new Dictionary(); to map something to something else. Now, at a certain point in the application, I need to remove a certain key from the Dictionary . I implemented this simple method: public function setCategoryNoValue( cat:TAModelCategory ):void { // delete( _categoryToValueDict[ cat ] ); var old:Dictionary = _categoryToValueDict; _categoryToValueDict = new Dictionary(); for ( var key:* in old ) { if ( key != cat ) {