一個項目我已經改變我的背景顏色,三種顏色之一以下方法:隨機選擇的對象 -
- (void) setBackgroundOfView {
// change the background color
UIColor *feijoa = [UIColor colorWithRed:0.565 green:0.82 blue:0.478 alpha:1]; /*#90d17a*/
UIColor *turquoise = [UIColor colorWithRed:0.2 green:0.78 blue:0.773 alpha:1]; /*#33c7c5*/
UIColor *lavendar = [UIColor colorWithRed:0.765 green:0.541 blue:0.898 alpha:1] /*#c38ae5*/
UIColor *randomColor = random.choose(feijoa, turquoise, lavendar) // in pseudocode
}
是什麼正確的方式做random.choose(feijoa, turquoise, lavendar)
?
是'index','Index'和'藍'同樣的指數?代碼中也有語法錯誤。 – 2014-10-04 19:43:14
已更新爲清晰 – 2014-10-04 19:45:47