WordPress noob attempts to help iPhone Dev Noobs.

Things I wish I’d known 2 years ago.

  1. Understand reference counting
    -If you alloc, copy, new or retain an object, you must release it.
  2. Understand Zombies
    -A deallocated object that your code thinks is still allocated.
  3. NSLog is your friend.
    -When in doubt, print it out.
  4. Messaging a nil object no-ops silently.
    -When you push a view controller onto your navigation controller and nothing happens, usually it’s because your navigation controller is nil.
  5. When things act weird, Clean your product and Reset the Simulator
  6. Connect your IBOutlets
    -If it’s not hooked up, it won’t show up.
  7. If you’re fighting the API alot, you’re probably doing it wrong.
  8. Quadruple punctuation is a red flag; triple is a yellow flag.
    [[[[[[anObject alloc] init] subViews] objectAtIndex:[Database funIndex] removeFromSuperview] retain] autorelease];
    This is just asking for trouble; break it into multiple simpler statements.  You can thank me later.
  9. Get out of the appDelegate as soon as you can.
    -Create your main view controller and then go there.  Don’t do UI, controller or database work in the app delegate unless you have to.  Leave the appDelegate for app level stuff (foreground and background, external notifications, etc.)
  10. Treat Warnings as Errors (config your Project Build Settings, under GCC – Warnings).
  11. StackOverflow totally rocks.