Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

estupefactika

macrumors member
Original poster
Hi, I have a NsMutableArray, at each index there are several keys like:

Arrat🙁
{
id=0;
img="xxx";
act="xxx";
},
{
...
}

...
)

I would like to replace the value for a determinate key of my array in an index. In documentation I see:

- (void)replaceObjectAtIndex🙁NSUInteger)index withObject🙁id)anObject

It would be easy if my array was only index no keys, but with several keys... Any Idea?
 
Yes, its an array of NsMutableDictionarys, but how can I to replace? Have I to create a new nsmutabledictionary, to remove the index in array and to add the new NsMutableDictionary to this index? Only I want to replace a key for an index of array.
 
If you only want to change one key at one index you could do

[[myArray objectAtIndex:i] setObject:newObject forKey:key]
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.