​​ ​

The Apple Support Community will permanently close on November 20, 2026. Starting today, the site will no longer accept new posts and is available in a read-only state.


You can continue to find trusted guidance and support on the official Apple Support site. 


We want to thank the community members who have contributed their time and expertise to help others with their Apple products.


newbie xcode user- trying to clear text field with button

Hi. I am trying to make a very simple iPad app which has a text field that I want the user to be able to clear or erase by tapping a button. Is there a way to do this? Basically assign an action that clears all text and starts over? I hope that make sense. All help appreciated.

Posted on Feb 21, 2013 6:59 PM

5 replies

Feb 21, 2013 7:22 PM in response to donny

[[selftextField] setStringValue:@""];


Assuming that textField is the name of the TextField in your window. (At least this is for OS X, I'm assuming IOS should be the same for something like this).


If this still isn;t clear then with all due respect you need to start with something simpler. There are good tutorials on the Apple site which will walk you through your first IOS (or OS X) app and get you familiar with some of the basics of Objective-C and Xcode.


regards

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

newbie xcode user- trying to clear text field with button

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.