Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

moonman239

Cancelled
Original poster
Mar 27, 2009
1,541
32
I have a client. This client wants me to show her an app that takes an array and arranges it in a way that is out of order.

Maybe I could use NSSet.
 
You have an array, you want to show its contents out of order.

To achieve this you can shuffle your array, to do so you can use in a loop:
Code:
arc4random_uniform()
and
Code:
exchangeObjectAtIndex:withObjectAtIndex:

Having your array shuffled, you can then iterate through your array like you normally would, displaying each object.
 
NSSet isn't necessarily disorderly. The order is unspecified and may change at any time, so it might be disorderly, but it's not necessarily so.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.