I have an NSMutableArray named as totalunits. It has some data. Each data has value like this. ({blah blah blah},{blah = 1}).
The second value should change to 0 instead of 1. Thats what I explained in following codes.
NSMutableDictionary *inappDict=[[NSMutableDictionary alloc] init];
[inappDict setObject:@"0" forKey:@"inapp"];
[[totalunits objectAtIndex:currenttag] replaceObjectAtIndex:1 withObject:newDict];
But using this, I’m getting an exception like this:
[__NSCFArray replaceObjectAtIndex:withObject:]: mutating method sent
to immutable object.
Help me.
Thanks in advance
You’ve initialized your
NSMutableArrayasNSArray, so it has no mutation methods; double check, that you need to operationNSMutableArrayand notNSArray