A strong reference keeps its referenced object in memory while the reference exists. An object remains alive while at least one strong reference points to it; two opposing strong references can form a retain cycle that prevents release. section 7.3.3
Recognize strong-reference failures through recurring memory patterns:
- Repeatedly visiting a screen increases memory because transaction data and decoded images remain retained after the screen disappears. section 7.3.3
- Closures can capture their owning object, delegates can retain each other, and notification listeners can remain registered indefinitely. section 7.3.3
- Replacing one side of a retain cycle with a weak reference breaks the cycle and allows memory to return to its starting level. section 7.3.3
Diagnosing a navigation leak
Use Allocations to compare memory before and after repeatedly opening and leaving an account overview. Use Leaks to inspect the object type, size, and reference diagram; identify the opposing strong references, then change one relationship to weak. section 7.3.3
