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?

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top