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!

Thanks for reading! And if you want to get in touch, I'd love to hear from you: chris.hulbert at gmail.