如何在代碼中更改此數字「63」?隨機CGPoint使用uiimageview
-(void)up
{
[UIView animateWithDuration:[self randomFloatBetween:1.0 and:0.3] animations:^{
m1.center = CGPointMake(63, 210);
}];
[self performSelector:@selector(down) withObject:nil afterDelay:[self randomFloatBetween:1.0 and:0.5]];
}
從我的CGPointMake 63號應該是隨機的。所以對於數字63我需要隨機這些數字:160 & 257.
我的「m1」圖像,出現在CGPointMake(63,210)或257.隨機。 Thnaks很多。
'arc4random()'。 – Kevin
請你解釋一下。我是初學者。謝謝 – user1625435
http://stackoverflow.com/q/160890/900873 – Kevin