I am working with the project where i am doing manual retain and release. I have come across one of many tutorials related to this on the following link.
http://www.drdobbs.com/mobile/automatic-reference-counting-on-ios/240000820
I am little confused from the above link. Under ‘Managing by Messaging’ title, they mentioned if i use ‘alloc/init’ it increases the ref. count to ‘1’, if I again ‘retain’ it, it again increases and becomes ‘2’ and again use ‘retain’, becomes now ‘3’, but they are NOT ‘releasing’ three times to completely free this memory, instead they are freeing only two times. How this is possible? I’m little confused after seeing this.
They’re not only releasing two times, they’re just showing that they’re releasing until the retainCount is 0, which is correct.