Convert a string into an int

后端 未结 11 2478
别跟我提以往
别跟我提以往 2020-12-04 14:51

I\'m having trouble converting a string into an integer. I googled it but all I can find is how to convert an int into a string. Does anyone know how to do it the other way

11条回答
  •  生来不讨喜
    2020-12-04 15:52

    I had to do something like this but wanted to use a getter/setter for mine. In particular I wanted to return a long from a textfield. The other answers all worked well also, I just ended up adapting mine a little as my school project evolved.

    long ms = [self.textfield.text longLongValue];
    return ms;
    

提交回复
热议问题