0
このような配列出力があります。iphoneの配列内のアレイからの配列値の置換
{
id = 1;
user = {
name="ABC"
}
},
{
id = 2;
user = {
name="XYZ"
}
},
私は番号5と6でidを "asd"と "fgh"で変更する必要があります。私の配列定義はここにあります。
myArray=[[NSMutableArray alloc]initWithArray:statuses];
ここで私のアプローチは "id"のchaningです。
[[myArray objectAtIndex:0]replaceObjectAtIndex:0 withObject:@"5"];
[[myArray objectAtIndex:0]replaceObjectAtIndex:0 withObject:@"6"];
しかし、私は次のacceptionを取得しています。
[__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'
私はちょうど編集したか確認してください。 – user851954
代わりに試してみてください:myArray = [statuses mutableCopy]; – Daniel
私は変更されましたが、まだ同じ問題です。 – user851954