- save those 8 positions in 8 CGRects.
- then generate a random number between 1 and 8 using
int r = arc4random() % 8
;. - using
switch
statement set theCGRect
of the button depending on r.
int r = arc4random() % 8
;.switch
statement set the CGRect
of the button depending on r.