title: Is it ok to use "classic" malloc()/free() in Objective-C/iPhone apps?
body: <p>I've been playing around with iPhone development for a while, and although it feels a bit awkward when you're a "hard core" .NET developer, it's not all that bad once you get used to it.</p>
  
  <p>In every book I read about Objective-C, there's only talk about <code>retain</code>/<code>release</code> (reference counting) for memory management. As an old-skool C/C++ developer, it seems strange that allocating the "normal" way, using <code>malloc()</code> and <code>free()</code> is only mentioned in some footnotes.</p>
  
  <p>I know that <code>malloc()</code> and <code>free()</code> work in Objective-C, but I'm curious if it is common practice or not. After all, if I want to allocate an array of 100 integers, it seems that this is the most efficient way to do it:</p>
  
  <pre><code>int *array = malloc(sizeof(int) * 100);
  
  memset(array,0,sizeof(int) * 100);
  
  // use the array
  
  free(array);
  </code></pre>
  
  <p>Is this indeed the best way, or should I avoid plain C memory management?</p>