Skip to content

Instantly share code, notes, and snippets.

Created December 19, 2012 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4340703 to your computer and use it in GitHub Desktop.
Save anonymous/4340703 to your computer and use it in GitHub Desktop.
Nice reversal of an array listing. i think you can then use the reversedMessages as the datasource array for the table
NSMutableArray* reversedMessages = [NSMutableArray arrayWithCapacity:[messages count]];
NSEnumerator* reverseEnumerator = [messages reverseObjectEnumerator];
for (id object in reverseEnumerator)
{
[reversedMessages addObject:Object];
}
// http://stackoverflow.com/questions/7457944/reverse-a-nsarray-worry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment