Quote:
Originally Posted by inflecsys
By using autorelease, you are making the object to be placed ion autorelease pool.
Yes, if you are not doing memory management on your own and
NO, if you are doing memory management on your own.
No compulsion to write. Please refer the above two questions.
Please refer the above questions.
It depends on you. Please refer the above questions.
|
You put it in so simple terms but I'm really confused about the fact that while I'm allocating one single object and giving it away, it should(?) have just one reference, but it has 3.
How am I sure that if I don't write autorelease it will get released by the object who owns it?
Because the fact that the original had an "autorelease" makes me doubt of the fact that, while I can be perfectly fine managing my own memory, the API still needs that I make a call to autorelease every now and then.
I mean, to me and my code, putting an autorelease there is exactly the same. I don't own the object, the API does, the API should release it.
Is it exactly the same for the API?
Will it make the appropriate release calls?