开发者

how to set text Field value in iphone

开发者 https://www.devze.com 2023-01-26 05:58 出处:网络
i have tried update the 开发者_如何学编程value of text fields but they are show the old values,

i have tried update the 开发者_如何学编程value of text fields but they are show the old values,

code--

double lastValue;
lastValue = [strLastval doubleValue];
textPriceAtExp.text=[NSString stringWithFormat:@"%0.2f",lastValue];  

frist time show the correct value but enter the text fields value show the old values.

the lastValue gaine the html data. any help plz thanks


The first thing to check is that the UITextField you created in IB is actually connected to the UITextField in your code (textPriceAtExp).


The codes are too few. So all I can help you is to guess what happens. Maybe the textPriceAtExp is nil, because it is a property, not a member variable. Maybe the strLastval is the old value, so nothing is wrong.

You can use NSLog() to check some value of the variables in codes.

0

精彩评论

暂无评论...
验证码 换一张
取 消