4 ms·
Yes, you're right: If you create objects yourself and don't pass them through certain Cocoa library code, they will not be autoreleased. What I meant, however,
by microtherion 16y ago
Yes, you're right: If you create objects yourself and don't pass them through certain Cocoa library code, they will not be autoreleased.
What I meant, however, is that most nontrivial Cocoa apps are likely to end up with a checkerboard allocation pattern, where the client allocated, controlled-lifetime objects are interspersed with Cocoa library allocated autoreleased objects with somewhat longer lifetimes, which may interfere to some extent with any strategy relying on controlling your object lifetime.
Still, people can and do avoid autoreleasing objects if their lifetimes are well known in advance.