iOS First Application “self.userName = textField.text”. When to use self
问题 Here is a code snippet from Apple's "Your First iOS Application" document. - (IBAction)changeGreeting:(id)sender { self.userName = textField.text; NSString *nameString = self.userName; if ([nameString length] == 0) { nameString = @"World"; } NSString *greeting = [[NSString alloc] initWithFormat:@"Hello, %@!", nameString]; label.text = greeting; [greeting release]; } I understand that self.username calls the synthesized set method (important since it has a copy flag). Why is textField.text and