mercredi 7 janvier 2009

Iphone programming

Or is this called scripting? :-)

I started with Xcode and Iphone programming quite naively thinking my C experience on the nds would help me out. Not at all! Xcode's Objective-C is quite different. Luckily there are a few tutorials around (they are everywhere - everyone seems to make about 10 a day). Following a tutorial is great, eventually it works, but you have no clue why. Idem for the interfacebuilder.
SO in the end only doing it yourself helps and then it becomes clear that the tutorials only give you the most simple situations.
Anyway some tuto's were helpful, here a few links to them:

The first step:
get to know the apple tutorials! These are the best found on the apple iphone dev site:
http://developer.apple.com/iphone/

lots of other tutorials can be found, for instance:
http://icodeblog.com/2008/10/20/iphone-programming-tutorial-using-uitouch-to-drag-an-image-around-the-screen/
http://www.bit-101.com/blog/?p=1784
http://www.iphonesdkarticles.com/2008/07/first-iphone-application.html
http://www.appsamuck.com
but i think, with hindsight that the apple examples are just the best.

following these tutorials is ok, but learning to work with the interface builder cannot be achieved this easy. For understanding the interface builder you could try these links:
http://en.wikipedia.org/wiki/Interface_Builder
http://developer.apple.com/tools/interfacebuilder.html

Then comes the moment that you start making your own classes. Objective C has a curious way to declare the variables, properties, and call functions with mutiple variables...
a few links can facilitate the process of getting used to Objective C:
http://cocoadevcentral.com/d/learn_objectivec/
http://www.otierney.net/objective-c.html
http://en.wikipedia.org/wiki/Objective-C

also arrays are used different from normal C, be careful!

The emulator of the iphone is very handy, because uploading to your iphone is quite an effeort with certificates and signatures (after paying the fee for becoming a developer)
Turning the emulator is easy with Command LEFT or RIGHT.

Uploading an application can be done, having the certificates and codes and signatures.
But jailbreaking or hacking is seems also possible. I tried but my MacBook is just the only MAC machine which refuses this apparently.
http://www.iclarified.com/entry/index.php?enid=1881
http://www.hackthatphone.com/114/iphone_step2_mac.html