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