Search code examples
iphoneobjective-cxcoderandomarc4random

arc4random Random Number Generator


int randomNumber = (arc4random() % 83) + 1;

Is this the best way to generate "the most random" number? Or is there a better way to generate a random number?


Solution

  • arc4random has a superior algorithm for generating random numbers based on the current time. There are other rand functions but they are not as good and require seeding.