NSMutableArrayにコピーされているクラスのオブジェクトがあります。私はそれを5回行います。ただし、その配列からオブジェクトを取得しようとすると、それらはすべて同じになります。
サンプルコードは次のとおりです。
[myProperty setAddress:@"Av. dos Estados, 70."];
[myProperty setPropType:casaRua];
[myProperty setRentalPrice:1430.0];
[propertiesArray addObject:myProperty];
myProperty = [propertiesArray objectAtIndex:0];
NSLog(@"Price 0 %.2f\n", [myProperty rentalPrice]); //In this I got 1430.0
[myProperty setAddress:@"Av. das Nações, 10. Ap: 103."];
[myProperty setPropType:apto];
[myProperty setRentalPrice:450.0];
[propertiesArray addObject:myProperty];
myProperty = [propertiesArray objectAtIndex:0];//indexPath.row];
NSLog(@"Price 0 %.2f\n", [myProperty rentalPrice]); **//In this I got 450.0???**
myP = [propertiesArray objectAtIndex:1];//indexPath.row];
NSLog(@"Price 1 %.2f\n", [myP rentalPrice]); //In this I got 450.0
私は何が間違っているのですか?配列がaddObjectで上書きされたようです