title: Help me understand memory management in Objective-C and Cocoa
body: <p>Don't shoot me, I know this must have been asked a thousand times...</p>
  
  <p>I am not comfortable with the lack of good documentation on Objective-C memory.  I understand alloc, dealloc, retain, release and all that but there is some confusion left in my head.</p>
  
  <p>Is it just lazy programming or does Objective-C do some 'behind the scenes' automagic activity in regard to allocating memory?</p>
  
  <p>Coming from a C background (centuries ago), I know that pointers are just pointers... you also have to reserve space for what the pointer points to or you will start stomping on your own program and other variables.</p>
  
  <p>The code examples I find (and that are in the books I read - all of which are sadly out of date with the current version of XCode and Interface Builder) never seem to allocate storage space for some objects such as NSString.  They declare a pointer (eg. NSString *aString;) then start assigning text to the string.  No allocation of memory for the string is every invoked!?!? So are all these examples just lazy code looking for a place to crash?</p>
  
  <p>Also, books talk about declaring 'pool' memory and that it is automagically inserted into your code.  When I create projects, classes and objects, no such code is to be found anywhere.  Has Apple done away with this automatic insertion or is it something that happens during compile time?</p>
  
  <p>Is there a penultimate reference book or website that will explain all this once and for all? </p>