We can use the C function rand() for this: int i = rand()%10+1; NSLog(@"Random Number: %i", i); This generates an integer between 1 and 10. Alternatively you can use the arc4random function: int i = arc4random() % 10; NSLog(@"Random Number: %i", i); This will generate a random number between 0 and 9. One thing of note is that often this function will generate the same number multiple times in a ro
![How to generate a random number in iOS](https://cdn-ak-scissors.b.st-hatena.com/image/square/17d78735d5a7aad568b46eb55bc6f392fd51cd25/height=288;version=1;width=512/https%3A%2F%2Fwpguru.co.uk%2Fwp-content%2Fuploads%2F2014%2F02%2Fcropped-WP-Guru-App-Icon.png)