This is how I create an int:
int randNumber = rand() % 4;
NSLog(@"%d", randNumber);
However, every time I run the application, the number is the same no matter what.
I created a button and applied an action to it that reinitializes a random number and writes a new number, and then generates a random number, but when starting the application, the random number is always the same (I ran it more than 20 times).
Any idea why the random number is always the same when starting the application?
Talon source
share