У меня есть вывод массива, как этот.
{
id = 1;
user = {
name="ABC"
}
},
{
id = 2;
user = {
name="XYZ"
}
},
Я должен изменить id с номерами 5 и 6 и имя с помощью "asd" и "fgh". Мое определение массива здесь.
myArray=[[NSMutableArray alloc]initWithArray:statuses];
А вот мой подход к повторению "id".
[[myArray objectAtIndex:0]replaceObjectAtIndex:0 withObject:@"5"];
[[myArray objectAtIndex:0]replaceObjectAtIndex:0 withObject:@"6"];
Но я получаю следующее согласие.
[__NSCFDictionary replaceObjectAtIndex:withObject:]: unrecognized selector sent to instance 0x6511810
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary replaceObjectAtIndex:withObject:]: unrecognized selector sent to instance 0x6511810'