What is the difference between a weak reference and an unowned reference?
问题 Swift has: Strong References Weak References Unowned References How is an unowned reference different from a weak reference? When is it safe to use an unowned reference? Are unowned references a security risk like dangling pointers in C/C++? 回答1: Both weak and unowned references do not create a strong hold on the referred object (a.k.a. they don't increase the retain count in order to prevent ARC from deallocating the referred object). But why two keywords? This distinction has to do with the