I try to change the value in a multidimensional array, but I get a compiler error:
warning: passing argument 2 of 'setValue:forKey:' makes pointer from integer without a cast
This is my content array:
NSArray *tableContent = [[NSArray alloc] initWithObjects:
[[NSArray alloc] initWithObjects:@"a",@"b",@"c",nil],
[[NSArray alloc] initWithObjects:@"d",@"e",@"f",nil],
[[NSArray alloc] initWithObjects:@"g",@"h",@"i",nil],
nil];
This is how I try to change the value:
[[tableContent objectAtIndex:0] setValue:@"new value" forKey:1];
Decision:
[[tableContent objectAtIndex:0] setValue:@"new val" forKey:@"1"];
So the array key is a string type - something strange, but useful to know.
source
share