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

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -