Posted by Mattias Sandström on April 5, 2009
When it comes to coolness and technology, nothing is cooler than the Cocoa Touch platform (a.k.a the iPhone or the iPod Touch). Since I got my hands on my iPod Touch 18 months ago and the iPhone last summer, I have been eager to try to actually do some programming on this device to see what it can do. Since I visited the Apple event at KTH (Royal Institute of Technology in Stockholm) in early December 2008 and met fellow programmers and developers during the day I have had it as a mission to at least try programming this thing. A couple of weeks ago I bought the book “Beginning iPhone Development” by Dave Mark and Jeff LaMarche (published by Apress) and after doing the first chapters, the book sat on my desk until I picked it up in the beginning of the week when my iPhone Developer Account got approved by Apple and I could finally leave the Simulator and start developing on the actual device.
A whole new world has opened in front of me! Apple’s Xcode and Interface Builder are two fantastic tools that offers pretty much all the functionality a programmer need. After some hunting around the ‘Net to find out how to adjust Xcode around the most annoying default settings, we are now great friends.
Programming Objective-C still gives me a sort of awkward feeling on being at ease but never sure when the ceiling is going to fall down. Much of the language is similar to C but the Objective stuff still gives me the creeps - the syntax is pretty darn ugly and the language structure is.... interesting I think the word is... A book on Objective-C will soon be ordered from Amazon....
The biggest hurdle yet has been to get the program to run on the device itself. Everything is take care of from the “iPhone Developer Program Portal” where there are really good guides and how-to:s available - if you do take the time to read and follow them... My first tries where instinctive and of course I failed - badly...
For the initial setup I spent about 30 minutes generating Certificates, App ID:s, Provisioning Profiles and Distribution Certificates. Apple’s way of making the iPhone/iPod Touch platform available to 3rd part developers involves a massive layer of security to protect the devices from malicious (i.e. unsigned) code. Initially I am only interested in the “Ad Hoc” distribution method (allowing up to 100 devices to run my applications) and with the help of the guides I managed to get Hello World on my iPhone 3G:

Some aspects of this process are really crazy and could take a couple of hours to solve...
The process of setting up the compilation to a distributable application from Xcode is not directly straightforward and you need to change similar settings in two places (the Project and the Target). After this, selecting the correct build profile and then build will do the trick.
Just getting the application over to my PC from my Mac caused me lots of grief as the instructions on Apple’s web-site says that you should compress the app on the Mac-side but iTunes on my Windows machine simply ignores that. Unzipping the zipped file does not work as iTunes starts complaining about the provisioning file... I ended up simply copying the app to the NAS and from there drag the Directory (as the app is) to iTunes and voila - it worked!
I have a couple of projects that I will start working on during the next weeks and see how an iPhone application could interact with the rest of the products from Tangix. Stay tuned....
--Mattias
Copyright © 2005-2012 Tangix Design & Development. All rights reserved