0

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?

Community
  • 1
  • 1
Phillip Senn
  • 46,771
  • 90
  • 257
  • 373
  • possible duplicate of [Underscore prefix on property name](http://stackoverflow.com/q/5582448/) http://stackoverflow.com/q/6049269/ http://stackoverflow.com/q/2371489/ http://stackoverflow.com/q/7174277/ http://stackoverflow.com/q/5659156 http://stackoverflow.com/q/837559/ http://stackoverflow.com/q/6146244/ http://stackoverflow.com/q/10651535/ http://stackoverflow.com/q/6124109/ http://stackoverflow.com/q/8145373/ http://stackoverflow.com/q/3521254/ http://stackoverflow.com/q/6064283/ http://stackoverflow.com/q/9696359/ http://stackoverflow.com/q/5521499/ http://stackoverflow.com/q/2114587/ – jscs Oct 22 '12 at 22:14
  • Thanks Josh! I'm following these links and am learning a lot! – Phillip Senn Oct 23 '12 at 19:27

1 Answers1

4
  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.

deleted_user
  • 3,817
  • 1
  • 18
  • 27