I guess your lazy loading code overloads the get method of the attribute. Self.x actually calls the [self x] method. If you use self.x in the get method, then self.x calls it again. , [self x] method, this is infinite recursion.
If it is referenced, there will be no difference. It is the same pointer. If it is assigned, there is a difference. self.xx=oo First, xxretaincount -1 and then retain oo _XX is copied to point directly to oo. There is no retain step. Nor
Self. _x is the automatically created instance variable.
For example, you define the following attribute:
There is a bunch of hidden (simplified) code as follows:
I guess your lazy loading code overloads the get method of the attribute. Self.x actually calls the [self x] method. If you use self.x in the get method, then self.x calls it again. , [self x] method, this is infinite recursion.
If it is referenced, there will be no difference. It is the same pointer. If it is assigned, there is a difference. self.xx=oo First, xxretaincount -1 and then retain oo _XX is copied to point directly to oo. There is no retain step. Nor
I just guessed that you might be:
Then when you call self.some, it is equivalent to using [self some], and self.some in some calls [self some] again. . . A loop is formed. . .
Underscore means direct access, bypassing set and get. .