Difference between self.var and simply var

self.var calls the property for var. Behind the scenes, Objective-C automatically generates a getter for properties (or you can make one yourself, if so inclined), so self.var uses that getter. Plain var accesses the instance variable directly (i.e., it doesn’t go through the getter to get the value).

Leave a Comment