ios - Converting string to int for check answer -


for math question app have 2 random numbers generated have 4 buttons answers. want check answer if user pushes right button seems not work.

num1 , num2 labels random numbers generated in technically

num1.text = "(randomnum1)"

and num2.text = "(randomnum2)" thanks.

i have following code under button1 ibaction

    var sum = (num1) + (num2)     if btn1.titlelabel = (sum){             check.text = "right"                 } 

maybe should convert before add num1 , num2. (convert strings integers before adding them up, also, should convert string integer fisrt when comparing sum , btn.titlelabel)


Comments

Popular posts from this blog

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

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -