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); 

https://developer.apple.com/reference/corefoundation/1429997-cfpropertylistcreatedeepcopy?language=objc


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -