To the best of my knowledge, there are three ways to generate random numbers on the iPhone:
The first, SecRandomCopyBytes:
UInt32 randomResult = 0;
int result = SecRandomCopyBytes(kSecRandomDefault,                   sizeof(int), (uint8_t*)&randomResult);
if (result != 0)
      randomResult = arc4random();
The second, arc4random:
UInt32 randomResult = arc4random();
The last (and worst) rand():
UInt32 randomResult = rand();
Good luck with all your random things!
-Jon
|