Learning iOS Development for Free
“Can you recommend a good book for getting started with Objective-C?”
I get this question a lot, but there’s no need to spend any money or even to spend time digesting an entire book. I always point people to the Apple docs — the documentation is very modular and (mostly) very reliable.
But the sheer volume of documentation can be intimidating. So this is a list of articles, arranged in the order that I recommend you read to get started writing your first iPhone app. You can work through the whole list in a day or two. I’ve learned everything I needed to ship about 20 apps between the docs and a lot of Googling — this list is based roughly on the path I took through the docs to get started, and I think it will serve you well.
The only prerequisite you need is some knowledge of C and OOP. Let’s get started:
- Learning Objective-C: A Primer will show you the highlights of the language, and it explains the syntax for standard OOP practices.
- Your First iPhone Application will walk you through shipping the classic “Hello World” app, including showing you around the IDE.
- The View Controller Programming Guide: After building your Hello World app, you’ll have a taste of the Model-View-Controller architecture of the SDK. View controllers house a lot of the logic of most apps, and this guide will show you how to structure and decouple relationships between the views in your app.
- UICatalog is one of my favorite pieces of sample code. It will give you a huge head start on building views, with plenty of code that you can copy-paste. Read the code, and be sure experiment with changing some lines and running the code — you’ll be able to immediately see the effects.
- The memory management rules are vital. I recommend reading the whole guide eventually, but at the very least, read and memorize this one page.
- Build something! You’ve got all you need to get started — you will need to learn more (lots more), but the best way is to pick an idea, start building, and learn what you need as you go.
The clever among you will note that I covered views and controllers, but not models! At the very least, you’ll be using NSObject subclasses to model your data, so you should read and understand the class and the protocol.
If you need to store your data across app launches, there’s a lot of choices, and proper data modeling is well beyond the scope of this post. (Maybe next time.) I usually use straight SQLite, which does take a while to get comfortable with, but you could also use CoreData if you need something simple.
I’ll close with some of the most common guides/frameworks that I reference. At some point, you’ll end up learning all of these. But in the meantime, keep these links handy, and read whatever parts you need as you build your app:
- UIKit Framework Reference
- Foundation Framework Reference
- The Objective-C Programming Language
- The Memory Management Programming Guide
By the way, if you do learn better from books or videos, or want something other than the Apple docs, I recommend:
- this article, for a good list of books arranged by difficulty
- the Stanford CS193P course for a great set of video lectures and practice problems
Stay tuned — next time, I’ll cover some of my favorite open-source libraries that make app development a lot easier.
If you read this far, you should follow me on Twitter here.