Daily iOS
Memory and ARC

ARC deallocation steps

From the moment an object's last strong reference goes away until the memory is actually returned, what does ARC do? Walk me through it step by step.

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

release → strong count hits 0 → deinit (subclass, then parent) → stored properties are released, freeing child objects in a chain → weak references read as nil from then on, and if unowned references remain the memory stays until the unowned count hits 0 → free.

Share a question