A few days before New Year's Eve my wife asked me if it would be possible to create a simple iPhone app that she could feature in an upcoming presentation for one of her company's clients. Being the awesome husband that I am I said "No problem!". I had about 5 days.
While most of you were gearing up to celebrate the New Year I was spent most of the day finishing up the majority of the app. One of the basic features that I added in was the ability to add an employee to the user's addressbook. Not the most exciting feature in the world, but one that people always want.
The small hurdle that I ran into was that each employee's name wasn't split into first/last, but all on one line. The most efficient way to handle that is assume that the first word is the first name and everything else is the last. Granted, I am assuming a lot, but 95% of the people in this scenario only had two names: first and last.
Below is the code I used. Once again, not the most glamourous piece of Objective-C, but effective.