What does = operator in @synthesize mean? [duplicate]
-
13-07-2021 - |
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?
Solution
Yes the @synthesize will generate an instance variable in that case of _msgTextField;
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