ios - How to make random number from int to string -


i using swift make math question app made generator random number when run doesn't work. want random number show in label.

my code was:

    var randomnumber = arc4random() % 10     randomnumber = questionlabel.text 

how code converted string format. thanks

it looks trying assign text of label random number. wrong way around. need convert number string, can in swift using string interpolation:

var randomnumber = arc4random() % 10 questionlabel.text = "\(randomnumber)" 

as side note questionlabel shouldn't have uppercase q not refer class.


Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -