How do I get the text from UITextField into an NSString?

半腔热情 提交于 2019-12-03 10:20:48
Jilouc

Get the text inside the text field using the text property

NSString *name = yourNameField.text;
Eric Chai

Use the text property of UITextField:

NSString *userName = yourNameField.text;

How about:

userName = [NSString stringWithFormat:@"%@", yournamefield.text];

Two ways. It is a property and any property value can be accessed like this -

  • yournamefield.text
  • [yournamefield text]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!