Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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

Reply
Question marked as Best reply

Posted on Feb 21, 2013 7:04 PM

Set a string to "" (an empty string) and update the textfield with that string.

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

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 ID.