Re: Error In An App I'm making From A Tutorial I found
Re: Error In An App I'm making From A Tutorial I found
- Subject: Re: Error In An App I'm making From A Tutorial I found
- From: Sean McBride <email@hidden>
- Date: Tue, 23 Apr 2013 12:59:55 -0400
- Organization: Rogue Research Inc.
On Wed, 17 Apr 2013 12:22:03 -0400, email@hidden said:
>I didn't run the code, but to fix the build error, you want to change
>the line to:
>
> int index = arc4random() % array_tot;
>
>That picks a random number and then uses the modulus operation (% is the
>modulus operator in C-based languages) to get a value between 0 and
>array_tot - 1.
Even better: use arc4random_uniform().
Cheers,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden