removeObjectForKey:
INDEX>Foundation>NSMutableDictionary>
変更可能な辞書からキーを探してその項目を削除します
-(void)removeObjectForKey:(id)aKey
解説
変更可能な辞書からキー(aKey)を探してその項目を削除します。
返り値
( void )
なし
引数
( id )aKey
キー
フレームワーク
Foundation
クラス
NSMutableDictionary
Instance Methods
使用可能
10.0
参照
- removeAllObjects
- removeObjectsForKeys:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys: @"a",@"あ", @"i",@"い", @"u",@"う",nil]; NSMutableDictionary *aMutableDictionary = [ NSMutableDictionary dictionaryWithCapacity:1 ]; [aMutableDictionary addEntriesFromDictionary:dic]; [aMutableDictionary removeObjectForKey:@"あ"]; NSLog([aMutableDictionary description]); } @end