Replace a value in NSDictionary in iPhone

前端 未结 5 1358
悲哀的现实
悲哀的现实 2020-12-08 00:31

I have a array (dataArray) of NSDictionary \"item\". It has datas like \"david\" for key \"name\" and \"85\" for key \"marks\" etc for 5 students. I want to replace the mark

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-08 01:15

     // NSDictionary *dict = ...
        NSMutableDictionary *mutableDict = [dict mutableCopy];
        [mutableDict setObject:@"myObject" forKey:@"myKey"];
        dict = [mutableDict mutableCopy];
    

    I hope it helps

提交回复
热议问题