title: @property, @synthesize and releasing objects in Objective-C
body: <p>I developing iPad games. I encounter this thing. This is my sample code:</p>
  
  <p>Method 1:</p>
  
  <pre><code>Foo.h
  
  @interface Foo : UIView{
      UILabel *title;
      .... // Other objects like UISlider, UIbuttons, etc.
  }
  
  // I add @property for all the objects.
  @property (nonatomic, retain) UILabel *title;
  
  ... blablabla
  
  Foo.m
  // I synthesize all the properties.
  @synthesize title;
  ... blablabla
  
  // Release in dealloc method
  [title release];
  ....
  [super dealloc];
  </code></pre>
  
  <p>Method 2:</p>
  
  <pre><code>Foo.h
  
  @interface Foo : UIView{
      UILabel *title;
      .... // Others object like UISlider, UIbuttons, etc.
  }
  // But this time I didn't add @property, synthesize and release.
  
  Foo.m
  // When I need the label, I allocate it:
  title = [[UILabel alloc] initWithRect: CGRect(10, 10, 100, 30)];
  title.text = @"test";
  [self addSubview: title];
  [title release];
  </code></pre>
  
  <p>Both method 1 and 2 work, but what's the difference between the 2 methods (method2 has less code)?</p>
  
  <p>Which method should I use and why?</p>
  
  <p>Has it something to do with memory management?</p>