objective c - Add new value and key in existing NSMutableArray -
i have following array, however, there way add new key , value ( such age) each dictionary item in nsmutablearray after following initialization.
nsmutablearray* names = [nsmutablearray arraywithobjects: [nsdictionary dictionarywithobjectsandkeys: @"joe",@"firstname", @"bloggs",@"surname", nil], [nsdictionary dictionarywithobjectsandkeys: @"simon",@"firstname", @"templar",@"surname", nil], [nsdictionary dictionarywithobjectsandkeys: @"amelia",@"firstname", @"pond",@"surname", nil], nil];
you can using dip linking .
here sample code:
nsmutabledictionary mutablecopy = (nsmutabledictionary )cfpropertylistcreatedeepcopy(kcfallocatordefault, (cfdictionaryref)originaldictionary, kcfpropertylistmutablecontainers);
Comments
Post a Comment