axiom-objc-block-retain-cycles

Diagnose and resolve Objective-C block retain cycles using the weak-strong pattern.

Updated Dec 3, 2025
One-click install
npx skills add https://github.com/tuliopc23/flying-dutchman-app --skill axiom-objc-block-retain-cycles
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: axiom-objc-block-retain-cycles
Source: https://github.com/tuliopc23/flying-dutchman-app/tree/main/.claude/skills/axiom-objc-block-retain-cycles
Command: npx skills add https://github.com/tuliopc23/flying-dutchman-app --skill axiom-objc-block-retain-cycles

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill systematically diagnoses and helps resolve memory leaks in Objective-C caused by block retain cycles, a common source of instability and crashes in iOS applications.

Core Features & Use Cases

  • Diagnose Retain Cycles: Identifies circular references between objects and blocks using memory analysis tools.
  • Apply Weak-Strong Pattern: Guides the implementation of the mandatory weak-strong pattern to break retain cycles.
  • Handle Nested Blocks: Provides solutions for complex scenarios involving multiple nested blocks.
  • Use Case: When a UIViewController fails to deallocate after being dismissed, and Instruments points to a block callback, this Skill provides the exact steps to find the cycle and fix it using the weak-strong pattern.

Quick Start

Use the axiom-objc-block-retain-cycles skill to diagnose a suspected memory leak in an Objective-C block.

Frequently Asked Questions about axiom-objc-block-retain-cycles

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix an Objective-C block retain cycle causing memory leaks?

Fix an Objective-C block retain cycle by applying the weak-strong reference pattern to break circular references between objects and blocks. This Skill systematically diagnoses the cycle and guides implementation of mandatory patterns to resolve the memory leak.

Why does my iOS UIViewController fail to deallocate after being dismissed?

A dismissed iOS UIViewController fails to deallocate when a block callback creates a retain cycle. This Skill diagnoses the circular reference using memory analysis tools and provides exact steps to find the cycle and fix it with weak-strong patterns.

What is the weak-strong pattern for debugging iOS memory leaks?

The weak-strong pattern for debugging iOS memory leaks involves capturing a weak reference to self outside a block and a strong reference inside. This Skill provides systematic diagnostic rules and mandatory implementation patterns to break Objective-C block retain cycles.

How do I handle retain cycles in nested Objective-C blocks?

Handle retain cycles in nested Objective-C blocks by applying diagnostic rules to resolve multiple circular references. This Skill provides specific solutions for complex nested block scenarios and addresses common pitfalls like hidden self-references in macros.

Can I use Instruments to find hidden self-references in Objective-C blocks?

You can use Instruments to find hidden self-references in Objective-C blocks by identifying circular references pointing to block callbacks. This Skill systematically diagnoses these common pitfalls and provides mandatory patterns to resolve the resulting crashes from deallocated objects.