title: Some beginner Objective-C/iPhone questions
body: <p>I'm just starting out (reading up a lot for the past couple of days). Here's some questions that I have stacked up, hopefully someone can answer them.</p>
  
  <p><strong>1.</strong> the (self != nil) check in initializer code. Why do it? To prevent accidental access to some "run-only-once" code that's wrapped up in there? Where from could this accidental access come from? Doing such checks suggest that I don't have control over what's going on.</p>
  
  <p><code><pre>
  - (id)init {
      self = [super init]
      if (self != nil) {
      // Code..
      }
      return self;
  }
  </pre></code></p>
  
  <p><strong>2.</strong> How is it that you don't have to free up anything that static methods return? (or this is the idea I've got)</p>
  
  <p><strong>3.</strong> How is str = @"Hi there!" different from</p>
  
  <p><code><pre>str = [[NSString alloc] initWithString:@"Hi there!"];</pre></code></p>
  
  <p>As I understand, you have to release str in aquired with second method, but not with first? If so, when does the first one get released? Which one is preferable (not minding the typing length)?</p>
  
  <p><strong>4.</strong> What is autorelease, if iphone has no garbage collection? I've noticed something called "an autorelease pool" being created in main.m. Is [myObject autorelease]; a way of adding myObject to the nearest wrapping "autorelease pool", which will release it? Basically, some magic to avoid releasing it yourself? Why use it?</p>
  
  <p>Well, thats it for now. Thanks for any answers!</p>