title: Objective-C Beginner (release) question
body: <p>I'm just starting to learn Objective-C. I read the Cocoa Become an XCoder book, and I think I learned the basics. Now, I'm following an online tutorial where I encountered this bit of code:</p>
  
  <pre><code>@synthesize name;
  
  - (IBAction)changeGreeting:(id)sender {
  self.name = textInput.text;
  
  NSString *nameString = name;
  if([nameString length] == 0) {
      nameString = @"Cartman";
  }
  NSString *greeting = [[NSString alloc] 
                        initWithFormat:@"Hello, my name is %@!", nameString];
  label.text = greeting;
  [greeting release];
  }
  </code></pre>
  
  <p>My question here is, shouldn't we call 'release' also on the *nameString variable? 
  Or by doing that I would clean also the 'name' property which should be released in the 'dealloc' method? 
  Cause if I understand correctly, I must call 'release' on all variables located inside functions at the end of those functions, but on the class properties I must call 'release' only in the 'dealloc' method?</p>
  
  <p>Thanks</p>