Posterous theme by Cory Watilo

Trim whitespaces on all text fields in a view controller

Often, after the user has edited a bunch of text fields, just before saving i want to trim the whitespace, because its all too common for the user to leave a space at the start or end of a 'username' or other important field.

So here's a chunk of code, put it in your view controller, and it'll trim all your text fields. Its worth looking at just to see how verbose the obj-c equivalent of .Trim() is!