Simply Hacking

Mac OS X and iOS Programming

Reversing an Array in Objective C

| Comments

Was looking for the best way to reverse an array in Objective C and stumbled over this solution that might not be obvious to everyone (wasn’t to me at least).

1
NSArray *reversedArray = [[array reverseObjectEnumerator] allObjects];

Comments