The Swift Programming Language
Since neither instances reference count can ever reach zero neither is ever deallocated, resulting in a memory leak. Swift provides the keywords weak and unowned to prevent strong reference cycles. These keywords allow an instance to be referenced without incrementing its reference count. Weak references must be optional variables, since they can change and become nil.102 Attempting to access an […]