IOS-NSDictionary

it2024-10-15  18

#import

 

int main(int argc, const char * argv[])

{

 

 

//可变字典

 

NSMutableDictionary * set = [[NSMutableDictionary alloc]init];

[set setValue:@"shdf"forKeyPath:@"1"];

[set setValue:@"abcd" forKey:@"2"];

 

[set setObject:@"higj" forKey:@"3"];

//删除一个

//[set removeObjectForKey:@"2"];

//删除多个

//NSArray * arr = [[NSArray alloc]initWithObjects:@"1",@"2", nil];

//[set removeObjectsForKeys:arr];

//删除所有

[set removeAllObjects];

NSLog(@"%@",set);

return 0;

}

转载于:https://www.cnblogs.com/ylg-----/p/4753023.html

最新回复(0)