ios - Mutating NSDictionary inside NSArray -
is there quick way of mutating nsarray of nsdictionaries? have big nsarray , want update value particular key inside nsdictionary. there quick way of mutating inner dictionaries update them.
assuming original array contains immutable dictionaries 1 way create new array mutable copies of of original dictionaries.
nsmutablearray *newarray = [nsmutablearray arraywithcapacity:oldarray.count]; (nsdictionary *dict in oldarray) { [newarray addobject:[dict mutablecopy]]; }
now of work on newarray
.
Comments
Post a Comment