[Solved] How to get NSDateComponents between two NSDateComponents?


You always add the same element to the array. The array just hold pointers to its
elements, therefore at the end of the loop, it contains n pointers to the same
object first. Changing

[array addObject:first];

to

[array addObject:[first copy]];

should solve the problem.

0

solved How to get NSDateComponents between two NSDateComponents?