title: String length Objective C
body: <p>As a mandatory validation, I check if my textfield is empty via this method:</p>
  
  <pre><code>- (NSString *) clean: (NSString *) str
  {
      return [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
  }
  </code></pre>
  
  <p>and while inserting in Database:</p>
  
  <pre><code>if([self clean:textfield.text].length == 0)
  {
  //Error
  }
  </code></pre>
  
  <p>I was wondering if I have to use &lt;= 0 ? to prevent some kind of fishy bug/error later on. Like we have in Websites(SQL injection and others). Can someone insert a negative length string in a textfield in iOS APP ?</p>