Android Developer Android Developer - 1 year ago 79
Objective-C Question

How to get numeric value from text field?

in Xcode 7.2 I set Keyboard type as Number Pad for UITextField. But when I try to read the value from the text field means app get crashed. I used following code to read the integer value.

int amount = [_amount.text intValue];

I googled and found same as suggested solution. Can anyone help me to solve this. Thanks in advance.

Answer Source

Please try this it will works for me.

int amount = [_amount.text integerValue];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download