UITextField.text is not always there!

If you have UITextField in your app and you want to validate a value or  see is there something in it you might think to write some code like this:

if (![addNewCellTextField.text isEqualToString:@""])

You would be right, but this will fail if the field is never touched! When a user taps the field, and it gets focus, UITextField.text = nil. That means that the condition above would be true, thats not what we want at all!

But once the UITextField is touched, the value becomes an instance of NSString with value of @””.  So make sure that you write your code to check for the nil case, like this:

if (addNewCellTextField.text != nil && ![addNewCellTextField.text isEqualToString:@""])

CFUnited 2010 here I come!

I will be speaking at this years CFUnited conference in Lansdowne Virgina, at the Lansdowne Resort

CFUnited is an annual conference based around the Coldfusion, Flex, and AIR languages and platforms.

This year I will be co-presenting with Luis Majano on “ColdFusion Powered iPhone Applications

The session will cover how to develop and power iPhone applications via ColdFusion REST Services. I will cover all the development basics, intricacies, best practices, etc of iPhone development. The focus will be on how to make an iPhone application connect and consume ColdBox REST services.

The ColdFusion portion of the session will be led by Luis Majano, Creator of the Coldbox Framework.

I’m really looking forward to this great experience. I will be posting the slides and sample code here, after the presentation.