UITextField *textField;
NSInteger intRollNumber;
I want to take rollNumber
as input from the textField
and store the value into intRollNumber
.
我想将rollNumber作为textField的输入,并将值存储到intRollNumber中。
How i do that? Because I am unable to convert the string into integer.
我是怎么做到的?因为我无法将字符串转换为整数。
Like this?
NSString *str = [textField text]
int RollNumber = [str intValue];
本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2009/05/20/6f8b2f04d9006cc0e8be8749d966b641.html。