U UberMonjie macrumors newbie Original poster Feb 11, 2009 18 0 Mar 5, 2009 #1 Code: if ([newMessageEntry text] != @"") { No worky! The condition always comes back true, regardless of if I type anything into newMessageEntry textview. How can I check to see if newMessageEntry actually had some text entered? Thanks!
Code: if ([newMessageEntry text] != @"") { No worky! The condition always comes back true, regardless of if I type anything into newMessageEntry textview. How can I check to see if newMessageEntry actually had some text entered? Thanks!
dejo Moderator emeritus Sep 2, 2004 15,982 454 The Centennial State Mar 5, 2009 #2 Compare against the length property of the text string. If it's == 0, there's no text.
U UberMonjie macrumors newbie Original poster Feb 11, 2009 18 0 Mar 5, 2009 #3 Yep! That did it, thanks!
dejo Moderator emeritus Sep 2, 2004 15,982 454 The Centennial State Mar 5, 2009 #4 UberMonjie said: That did it, thanks! Click to expand... Something even better I found: UITextView has a "hasText" instance method. So, Code: if ([newMessageEntry hasText]) { should do the trick.
UberMonjie said: That did it, thanks! Click to expand... Something even better I found: UITextView has a "hasText" instance method. So, Code: if ([newMessageEntry hasText]) { should do the trick.