ios - How to create an if statement which check if text field empty? -


मेरे पास तीन टेक्स्ट फ़ील्ड हैं, उन्हें नाम दें:

  1. textField1।
  2. textField2
  3. textField3

    मैं एक if स्टेटमेंट लिखना चाहता हूं यदि textField1 के मान (पूर्णांक) को textField2 और textField3 को बराबर 0 सेट करने के लिए बदल दिया जाता है, यदि वे

    इसी तरह textField2 के साथ textField1 और textField3, आदि को बदलने के लिए।

    मैंने यह जांचने की कोशिश की है कि

      textField2 = शून्य; यदि textField2 = @ ""   

    न तो काम!

    मैं ऐसा कैसे करूँ?

    यह जांचने का सबसे अच्छा तरीका है कि पाठ फ़ील्ड में कोई टेक्स्ट है:

      यदि (textField2.text.length == 0) { // कोई पाठ}     नहीं है

Comments

Popular posts from this blog

How can I add a seperate action listener to all 14 of my buttons at once that can determine player turn?(java) -

php - Sorting an multidimension array using usort fails -

Simple file compression in C -