What’s the difference between referring to an instance variable in an objective-c class as this:
self.myIvar
and
myIvar
if it’s been declared as a property in the header and synthesized?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you refer to self.myVar, it will use the @property declared in your header file.
For example
If you have
Retain Count will be 1
But if you use
Retain Count will be 2 because of the retain property.
It’s the same if you set setter || getter method in the @property.