Retain, then autorelease and then release does what?
Retain, then autorelease and then release does what?
- Subject: Retain, then autorelease and then release does what?
- From: Joel Rosenblum <email@hidden>
- Date: Sat, 4 May 2002 02:39:52 -0400
I read on Apple's site that "If you need to use an object after
disposing of its owner or rendering it invalid by some other means, you
can retain and autorelease it before sending the message that would
invalidate it."
This seems odd. It would make sense to retain it, then autorelease it at
the end of the method, but if you retain and autorelease it at the same
time, isn't that having zero net effect, thus allowing the subsequent
release to release the object as it would without this code?
Also, I'd like a bit of clarification on one point: if I have a property
of a class which the class retains, when the class is released, will all
of its objects automatically be released as well, or must I explicitly
release each of them at that time?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.