https://docs.swift.org/swift-book/documentation/the-swift-programming-language/automaticreferencecounting/#Unowned-References
结论:unowned 修饰的对象,需要保证其访问时总是有值的,也就是引用 unowned 变量的对象,生命周期要相等或更长。否则 unowned 对象释放后再访问就会 crash
本文标题:unowned & weak
本文链接:https://www.haomeiwen.com/subject/cefjidtx.html
网友评论