Asked 8 years ago
17 Nov 2016
Views 1223
jaggy

jaggy posted

what is alternative function in Objective C as like php rand() function ?

Hi

i know the PHP very well but learning the Objective C in ios and want to know if function related to generate random no as we do in php with rand()

echo rand();//it will print random number with each run it generate unique no.


what is function in Objective C for generating random Number ?
Mitul Dabhi

Mitul Dabhi
answered Nov 30 '-1 00:00

arc4random() is the function to generate random number


int rand = arc4random();

hope it help
Post Answer