Iphone UITextField only integer

前端 未结 9 708
借酒劲吻你
借酒劲吻你 2020-12-03 03:19

I have a UITextField in my IB and I want to check out if the user entered only numbers (no char)and get the integer value.

I get the integer value of the UITextField

9条回答
  •  醉酒成梦
    2020-12-03 04:09

    http://rosettacode.org/wiki/Determine_if_a_string_is_numeric#Objective-C

    Or you could ensure that only the numeric keyboard appears when the focus comes on the field

提交回复
热议问题