开发者

How can I take values from textbox and assign it to integer variable in Xcode?

开发者 https://www.devze.com 2023-01-07 09:08 出处:网络
how can I convert the valuesof textbox to numeric? here\'s what I\'m doing: int el = electric开发者_Go百科.text;

how can I convert the valuesof textbox to numeric? here's what I'm doing:

int el = electric开发者_Go百科.text;
int wb = waterbill.text;
int inet = internet.text;


Try this:

int el = [electric integerValue];
int wb = [waterbill integerValue];
int inet = [internet integerValue];


Try this:

NsInteger el = [electric.text integerValue];
NsInteger wb = [waterbill.text integerValue];
NsInteger inet = [internet.text integerValue];
0

精彩评论

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