ios - unexpectedly found nil while unwrapping an Optional value uint32 swift -
when try set results label string containing uint32 app crashes , error message "unexpectedly found nil while unwrapping optional value".
i figured meant have add ! variable when try issue "operand should have optional type, has type uint32.
var fingers = arc4random_uniform(6) result.text = "incorrect, holding \(fingers) fingers"
this surely work:
var result: uilabel = uilabel() var fingers: uint32 = arc4random_uniform(6) result.text = "incorrect, holding \(fingers) fingers" println("\(result.text)")
Comments
Post a Comment