I have to convert simple ARC code to non ARC. While it was relatively straight forward I missed an instance variable assignment self.var = xxx, instead I wrote var = xxx.
While in the ARC version it did not cause any trouble – in the non ARC version it certainly caused a crash.
Does that mean that it is actually OK to assign instance vars in ARC without the self. so they get retained?
Thanks!
ps what’s the best source to learn how to program in ARC so one avoids abvious errors – so far I did not find any problem at all but I am getting nervous that I might have missed something
Yes, kind of.
It is same as this.
obj_ has strong reference for assigned object. The assigned object will not be dealloc-ed until the owner object for the ivar is dealloc-ed.
Please refer to LLVM document or the Apple’s ARC reference that is still under NDA.