5 Starting Tips For Aspiring iPhone Developers

Posted by: Matt Magpayo on 10:17 am

iPhone SDKWith the iPhone solidifying its place as the smartphone to have, more and more developers are diving into iPhone development hoping to strike it rich in the AppStore like this guy. Below are 5 quick tips for aspiring iPhone devs, all I wish I had heard before my first day with iPhone development:

1. Before you dig into the examples, review the Objective-C syntax.

Before you even begin to look at code, you have to know what you’re looking at. If you are well versed in a language like Java or C#, you may find the Obj-C syntax found in the iPhone examples a bit hard to follow. Expect a whole bunch of seemingly random brackets and semicolons. The code will flow a lot nicer if you skim a couple of resources below:

2. Say goodbye to garbage collection.

If you’ve been developing in Java or C# for the past few years, you probably haven’t had to worry about GC. Sadly you are going to have to bid farewell to this privilege. Apple dubbed garbage collection too resource intensive to be on the iPhone, so say hello to a programming annoyance from the past. Below are a few tips to help you along the way with inevitable memory leaks:

  • Make sure every alloc, retain, or copy has a corresponding release.
  • Never call dealloc. Always use release.
  • Know when certain functions return auto-released objects. (This killed me in the beginning.)
  • Check out this helpful guide from Apple.

3. Ignore Interface Builder for now.

Yeah, just pay no attention to IB. It’s graphical programming will have some use later on, but I definitely do not recommend it for beginners. It hides too much of what is going on and the use of IBOutlet’s in code will just confuse programmers from other languages. Sadly, a lot of Apple’s examples utilize IB, but there still plenty that do not. Learn how to programmatically build interfaces first.

4. Don’t ignore the “low on memory” event – didReceiveMemoryWarning.

Memory is tight on the iPhone. When starting out, it’s easy to ignore handling the memory events, but you should get into the habit early on. Beginner programmers will experience a lot of memory related crashes for any significant application. Implement the handling of didReceiveMemoryWarning messages for all your views. In it’s implementation, just free up (release) all objects you can.

5. Check out the Stanford iPhone Development course materials.

Some good materials here for iPhone development in general. Contains all lecture notes, presentations, and assignments. Check it out here.