The title says everything!
In Objective-C, what’s the difference between self.propertyName vs. propertyName?
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.
self.propertyNameincrese the retain count by one if you have specified thepropertyNameas retain in property declarationpropertyName will not increase the retain count an could lead to the crash of application.
e. g. ,
lets say you have
namePropertyNSString object.Below increase the retain count by 1 and you could use self.propertyName and call
release.Below does’nt increase the retain count so if you use propertyName in your application it will result in crashing of your application.
Any further use of
propertyNamewill result in crash.