First, I am really new in this area, please forgive my slow,
I saw codes like
'@property (nonatomic) double topSpeed; ' in the header file to declare a public variable in class. It will create a setter and getter automatically.
And we declare the implementation to the setter getters in the implementation file like
"@synthesize topSpeed = _topSpeed"
I wonder why do we use _topSpeed? Since we didn't declare a variable called _topSpeed.
To be more straightforward, what are topSpeed and _topSpeed exactly? Are those both variables or methods name? Is that mean whenever we declared @property type something, it will automatically generate a variable called _something?
THank you.
I saw codes like
'@property (nonatomic) double topSpeed; ' in the header file to declare a public variable in class. It will create a setter and getter automatically.
And we declare the implementation to the setter getters in the implementation file like
"@synthesize topSpeed = _topSpeed"
I wonder why do we use _topSpeed? Since we didn't declare a variable called _topSpeed.
To be more straightforward, what are topSpeed and _topSpeed exactly? Are those both variables or methods name? Is that mean whenever we declared @property type something, it will automatically generate a variable called _something?
THank you.