Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

For example I just learned today about NARC. Never release something unless you made it "New, Alloced, Initialized or Copied". That just fixed a couple different bugs in my app that I couldn't find.

What other things are very important for iPhone development?


migration rejected from May 1 at 0:41

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as too broad by Snowman, MichaelT, gnat, GlenH7, durron597 May 1 at 0:41

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

Are you the only person on the project? Personal project or for your company? – JBRWilkinson Jan 20 '11 at 22:55
There basically is no more Community Wiki. Moderators control that now. – Walter Jan 20 '11 at 23:10
@JBRWilkinson: I am working alone, but you might as well give advice for working on a team too! – James P. Wright Jan 21 '11 at 1:36

6 Answers 6

Realize you are coding for a constrained device with a small battery. Test memory footprint and performance on actual devices. Watch the WWDC videos where they suggest how to not drain battery life.

Read the HIG.

User test your UI. Observe. Include users with less than excellent eyesight.

Examine all the llvm static analysis and Xcode build warnings.

What is the HIG? – James P. Wright Jan 20 '11 at 22:21
HIG = Apple's iOS Human Interface Guidelines. – hotpaw2 Jan 20 '11 at 22:25
HIG = Human Interface Guidelines – Anthony Jan 20 '11 at 22:26
+1 for low-vis users. Also low-dexterity users! Basically, get some test users who are over 45. ;) – Alex Feinman Jan 21 '11 at 17:48

The first thing to know about iPhone development is that you should talk about iPhone development. The second thing is to find out what the tools are capable of doing for you:

  • don't write UIs in code, when IB can do it for you
  • don't write sqlite-backed data models in code, when Core Data can do it for you
  • there is good i18n/l10n support in the frameworks, and tools to aid in translation
  • you should run Build & Analyse every day. It will tell you about bugs that you can't believe exist, but do.
  • Instruments can find many of the other bugs.

Other than that, you may think square brackets are odd today, but you'll be used to them in two days. Concentrate on learning the APIs, because there isn't much of Objective-C to learn and most of it was created to support the APIs.


Everything is pre-emptively multithreaded. Everything.

You can and will be interrupted in the middle of everyone of your damn functions, usually by the user tilting the screen or tapping somewhere, or from an incoming phone call. Plan for this, test for this, expect to get any message in any state. Handle programmatic interruption gracefully.

Write re-entrant, well-defended code. Don't assume you know what the state of the screen is at any minute. Stay away from interaction designs that include tasks that can't be interrupted.


Memory management and the rules of object ownership:

Mine go something like this:

  • An object which creates another has the responsibility to release it (i.e. autorelease or release depending on circumstances).
  • Any object which uses/holds on to another should retain it.
  • Be aware of cyclic dependencies (which is usually due to poor OO design).

The more you use the design patterns of Delegation, KVO and MVC in your code, the better your code will integrate with Cocoa Touch API.

Understanding bindings are also very important to implement KVO properly.



In my opinion Usability is most important!


Get ready to rework stuff with every iOS update. Our experience has been that even after following all the rules and passing the submission, Apple will do something to every new release that tweaks the rules just enough to break something in some really weird way...


Not the answer you're looking for? Browse other questions tagged or ask your own question.