Quote:
Originally Posted by exorcyze
It's true that prefixing with self calls the setter method. But the point is that in cases where no retain/copy/release is being performed in the setter ( IE when you specify assign, readwrite, etc for nonatomic properties ) that the two are functionally performing the same thing behind the scenes.
|
Usually but not always; I think jtara's point is that there are other situations where the setter and getter might do something other than directly set the ivar.
For example, I might have two properties, angleInRadians and angleInDegrees, but only one ivar for angle, and write getters and setters to modify that ivar. In that case, "self.angleInRadians = blah" would be correct, and just "angleInRadians = blah" would be an error.