Is there a canonical way to randomize an array in Objective C?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- back button text does not change
相关文章
- 现在使用swift开发ios应用好还是swift?
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- why 48 bit seed in util Random class?
- How can I add media attachments to my push notific
- How do you detect key up / key down events from a
There is none built into the SDK if that's what you are asking.
You can use just about any randomization or shuffling algorithm you want however. Different algorithms have different tradeoffs in terms of randomness, efficiency, etc.
http://en.wikipedia.org/wiki/Shuffling#Shuffling_algorithms
For algorithms that shuffle "in-place" start with a mutable array use
For algorithms that reconstruct the array, feed it the original and build a new array.