seniorObjective-C
Why do block-based APIs often cause hidden retain cycles?
Updated May 17, 2026
Short answer
Blocks capture strong references to objects they reference unless explicitly weakified.
Deep explanation
Blocks capture variables strongly by default, including self. If an object retains a block that also retains the object, a cycle forms. This is common in async APIs, animations, and completion handlers.
Unlock with a Pro subscription to view this section.
View pricingReal-world example
No real-world example available yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProCommon mistakes
No common mistakes listed yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProFollow-up questions
No follow-up questions available yet.
Unlock with a Pro subscription to view this section.
Upgrade to Pro