Xcode 7.3 Cannot create __weak reference in file using manual reference counting
更新Xcode 7.3后编译可能会出现这个错:cannot create __weak reference in file using manual reference counting
解决方法:
1.可以设置build setting -> Apple LLVM7.1 - Language - Objective C -> Weak References in Manual Retain Release YES
2.用 __unsafe_unretained
代替 __weak
,但是如果用 __unsafe_unretained
请注意下面的问题。
1 | __unsafe_unretained specifies a reference that does not keep the referenced object alive and is not set to nil when there are no strong references to the object. If the object it references is deallocated, the pointer is left dangling. |
扫描二维码或在微信中搜索 KeepMovingXin