objective-c - iOS - textfield到int变量

Fir*_*ejs 2 variables objective-c textfield ios

textfield和integer变量的问题.我使用textfield写一个数字,在函数中我使用这个数字.

int changeid = [idchoice text];
Run Code Online (Sandbox Code Playgroud)

但我必须重新打字,怎么样?

Aur*_*ila 9

int changeid = [idchoice.text intValue];
Run Code Online (Sandbox Code Playgroud)

完成.