I was using this in my iPhone app
if (title == nil) { // do something }
but it throws some exception, and the console shows that the ti
if(textfield.text.length == 0){ //do your desired work }