I"ve got a problem in a for loop I'm putting a NSArray into a tableview and I want the last object to be in the first cell, but it only works with the first object.
this works:
for(int i = 0; i < messages.count ; i++)
{
}
but this doesn't:
for(int i = messages.count; i > 0; i--)
{
}
and the error message is:
Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 203 beyond bounds [0 .. 202]'
*** First throw call stack:
(0x32bd33e7 0x3a8c4963 0x32b1eef9 0x891d3 0x34a01579 0x34a561f7 0x34a5613d 0x34a56021 0x34a55f4d 0x34a55699 0x34a55581 0x34a26561 0x349e58c7 0x34791513 0x347910b5 0x34791fd9 0x347919c3 0x347917d5 0x349eb93f 0x32ba8941 0x32ba6c39 0x32ba6f93 0x32b1a23d 0x32b1a0c9 0x366f833b 0x34a362b9 0x8549d 0x3acf1b20)
libc++abi.dylib: terminate called throwing an exception