내가 arc4random에 임의의 구문을 업데이트하기 위해 노력하고있어 스위프트 2 퀴즈 응용 프로그램을 만든 ...arc4random 스위프트 3 구문
if Questions.count > 0 && counter <= 15 {
QNumber = arc4random()% Questions.count
QLabel.text = Questions[QNumber].Question
AnswerNumber = Questions[QNumber].Answer
for i in 0..<Buttons.count{
Buttons[i].setTitle(Questions[QNumber].Answers[i], for: UIControlState())
}
Questions.remove(at: QNumber)
}
내가 당신의 질문을 이해 모르겠어요 값을 변환해야합니다 있도록
UInt32
매개 변수를 기대하고있다. (또한 modulo가 필요 없습니다; 대신에 arc4random_uniform을 매개 변수와 함께 사용해야합니다 (modulo bias를 피하십시오) (http://stackoverflow.com/questions/3420581/how-to-select-range -of-values-using-arc4random)) –변수 이름이 소문자로 시작하는 명명 규칙을 따르는 것을 고려하십시오. 코드를 읽는 것은 매우 어렵습니다. – vadian