문제

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?

도움이 되었습니까?

해결책

  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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top