Question

Possible Duplicate:
How does an underscore in front of a variable in a cocoa objective-c class work?
Underscore prefix on property name?

I'm new to XCode. I see where someone has: @synthesize msgTextField = _msgTextField;

and later they refer to the _msgTextField.

Q: Is the @synthesize statement creating a variable called _msgTextField?

Q: Why would it be backwards from an assignment operator?

Était-ce utile?

La solution

  1. Yes the @synthesize will generate an instance variable in that case of _msgTextField;

  2. Its not an assignment, its telling @synthesize specifically the name of the ivar to generate.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top