I know that in the main method an autoresource pool has been created, and all objects that receive an autostart message are stored in this pool and freed when the pool is depleted.
But they always say to avoid auto-implementing objects, to avoid memory leaks, and, in turn, application crashes.
Then why and under what conditions should we use autoreleasepool?
Apple docs offers us to use them when we use streams, so at the beginning of the stream we need to create an autorun pool and merge it at the end of the stream, but what if we do not create an autorun object in the full stream, then in this condition it is also necessary to create autoreleasepool in the beginning of the flow.
Please clear my confusion. Thanx.
memory-management objective-c nsautoreleasepool
Aisha Jun 18 '11 at 8:11 2011-06-18 08:11
source share