Simply Hacking home

Reversing an array in Objective C

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).

    NSArray *reversedArray = [[array reverseObjectEnumerator] allObjects];
blog comments powered by Disqus
Fork me on GitHub
Get Keyboard Pilot
Automatic layout switching
Download 30 day trial
Fork me on GitHub