根据key修改字典value

2019-08-22  本文已影响0人  Anday_

    // NSDictionary不能直接修改,先转换成NSMutableDictionary

    NSDictionary *dic=@{@"like":@"0",@"red":@"0"};

    NSMutableDictionary *mutableDic = [NSMutableDictionary dictionaryWithDictionary:dic];

    [mutableDicsetObject:@"1"forKey:@"HasLike"];

    [mutableDicsetObject:@"1"forKey:@"LikeNums"];

上一篇下一篇

猜你喜欢

热点阅读