Daily iOS
Memory and ARC

ARC follow-up drill

Starting from "explain ARC," the follow-ups keep coming. First: who inserts retain and release, and when?

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

The compiler inserts the retain/release calls after analyzing ownership during SIL optimization; the runtime only moves the count up and down according to those calls. The optimization level changes where they're inserted, so deinit timing can differ between debug and release.

Share a question