What is the best way to generate random numbers using Objective-C on iOS?
If I use (int)((double) rand() / ((double)(RAND_MAX) + (double) 1) * 5.0) to generate a number from 0 to 4, every time I start the program on the iPhone it generates the same numbers to start off with.
What is the best way to generate random numbers using Objective-C on iOS? If
Share
There is a very similar question here on StackOverFlow. Here is one of the better solutions (no need for seeding):