I know this is a really simple thing in obj-c, but I can’t seem to find anywhere (on here or google) how to do this. Basically I just want to replace one array value (the value is a NSString) with another, so something like this…
[sharedInstance.groundMap objectAtIndex:ii] = myImage;
But I get an error expression is not assignable. I also tried…
[[sharedInstance.groundMap objectAtIndex:ii] setValue:(NSString*) myImage];
But that gives an error too.
You need to be using an
NSMutableArrayto set a value. Use thereplaceObjectAtIndex:withObject:method or use the new Objective-C syntax:or
Neither works with
NSArray. OnlyNSMutableArray.