generating random values in iPhone

前端 未结 6 923
Happy的楠姐
Happy的楠姐 2020-12-20 00:18

I have used rand(). But it gives a specific value even after I restart application.

I have implemented following in my application.

- (void)viewDidLo         


        
6条回答
  •  感情败类
    2020-12-20 01:14

    arc4random() is a built-in function that does not require seeding (and so therefore does not produce predictable sequences that can be generated by using a seed), and it conveniently returns integers. I never use anything else.

提交回复
热议问题