retrieving integer value from the UITextField into a NSInteger variable
-
23-08-2019 - |
Question
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.
Solution
Like this?
NSString *str = [textField text]
int RollNumber = [str intValue];
OTHER TIPS
See the text property and integerValue.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow