I'm making a program that 's about a math test random generator.
But while I was creating a random operation. I used arc4random_uniform() to create a random number. Here's the function.
func generateQuestion() {
var randomoperation:UInt32 = arc4random_uniform(3)
if randomoperation == 0 {
operation = "+"
}
if randomoperation == 1 {
operation = "-"
}
if randomoperation == 2 {
operation = "X"
}
if randomoperation == 3 {
operation = "/"
}
}
This creates the error "Cannot assign a type of value "String" to type "UILabel" in swift"
How do you fix this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…