我有一個隨機放置在屏幕上的球體。如何設置隨機放置的物體的邊界以確保它不會落後iAd
-(void)PlaceSphere{
sphereX = arc4random() %492;
sphereX = sphereX + 34;
sphereY = arc4random() %249;
sphereY = sphereY + 39;
sphere.center = CGPointMake(sphereX, sphereY);
}
我目前在應用程序上有iAd。我如何設置它,使其不會落後於iAd?我沒有使用自動佈局,但我正在使用自動佈局。
我嘗試使用
sphereY = sphereY + 39 <= 275;
這並沒有進行得很順利,因爲它不停地重新出現在屏幕的頂部邊緣。