It has been painful learning to write programs for the iPhone. My C++ is shamefully rusty and I’ve done everything from a command line for years. So I have to learn ObjC and how to develop code in XCode.
The first thing you must do is sign up for the iPhone Developer Program. There is a free program that will get you the developer kit, manuals, and source code. Pay $99 and you can get the certificates that will let you load code onto your phone for testing or put it up on the iTunes store.
Once you’ve signed up you’ll need to download and install the developer kit onto your computer.
Then download all the sample code, you use it often.
(* Note: you must sign up for the developer program to download these manuals. They are all on the iPhone Developer site. I’d put them up here but nda says I can’t. )
The pdf manuals you’ll find most useful for getting started in ObjC and XCode are:
iPhone OS Programming Guide
ObjC
Then move onto both of these pdfs which walk you through simple projects:
ObjCTutorial.pdf
iPhone101.pdf
The icodeblog has several code examples and it walks you through in very tiny steps. I’ve found it to be a great help when I get stuck on something.
I have ‘Programming in Objective-C (Developer’s Library)‘, ‘Cocoa(R) Programming for Mac(R) OS X (3rd Edition)
‘ and ‘iPhone Open Application Development: Write Native Objective-C Applications for the iPhone
‘.
Programming in ObjC is not bad if you are new to programming and ObjC is your first language. Cocoa Programming for Mac is good for Cocoa if you know ObjC but it is all for desktop application, not iPhone applications. I found it to be the least useful of the three books.
The ‘iPhone Open Application Development’ book looks to have some interesting information, it is the better of the three if you are comfortable with ObjC and Cocoa. You can grab a used copy on Amazon cheap, but the pdfs and icodeblog website are more useful. Several books are supposed to be released this fall, but that’s still many months off.
If you have written code for cell phones before you’ll find much of the interface stuff is familiar. It’s just a matter of getting the hang of the Apple drag and drop GUI.
Simply working the projects in the examples isn’t going to teach you much. Be sure to create a program from scratch using what you’ve learned to be sure you’ve learned what you think you have learned. You will need to know how to interact with the user, gather info from user, manipulate it and return it to the user. You’ll also need to know how to set up a sqlite database and get information in and out of the database. Those skills alone will allow you to write about 90% of what needs writing.
If you want to write games you’ll want to brush up on or learn OpenGL and get the basics of that down. For a really cool example of 3d graphics on the iPhone check out iHologram
With GPS, a large screen, and internet access there is so much this phone will be capable of doing. There are things we won’t be able to live with out a year from now that are just sparkles in coders brains at the moment. Don’t wait for next falls batch of books.
If you are totally new to programming you’ll want to download the free pdf or buy Thinking in C++: Introduction to Standard C++, Volume One (2nd Edition) and dig into code get your basic stuff down first.
* I will add resources to this post as I find ones that are really useful.