Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

retrieving integer value from the UITextField into a NSInteger variable

UITextField *textField;
NSInteger intRollNumber;

I want to take rollNumber as input from the textField and store the value into intRollNumber .

How i do that? Because I am unable to convert the string into integer.

like image 597
SST Avatar asked Dec 21 '25 02:12

SST


2 Answers

Like this?

NSString *str = [textField text]
int RollNumber = [str intValue];
like image 88
dermdaly Avatar answered Dec 22 '25 15:12

dermdaly


See the text property and integerValue.

like image 37
Matthew Flaschen Avatar answered Dec 22 '25 15:12

Matthew Flaschen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!