Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.8k views
in Technique[技术] by (71.8m points)

objective c - 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Like this?

NSString *str = [textField text]
int RollNumber = [str intValue];

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...