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

c# - passing input text from view to contoller with FacebookContext using Facebook app -

ios - Does Core Data autoupdate a many to many relationship on saving -

Calling a C++ function from C# by passing a string with variable size to it -