ios - What does clear button set UITextField to? -


I have a piece of code that is responding to the text field. I want to see when . The text of the field is empty (either bypassed all the way or cleaned with a small round x button on the right).

If I .text == @ " my code works, the user provides backspace. This does not work if the user has used a clear button.

What does the explicit button set the .text of the text field? (I have logged it out and if I print it between two other characters, I see the blank.)

Maybe me just .text == @ "" ? Maybe .length == 0 or something else?

thanks !

"Clear" button probably sets text property to zero .

Whenever you want to see that the text is free to use:

  if there is no text (some text is zero in someText.length == 0) {// soneText }  

This works for empty code as zero values.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -