Home > AI > Uncategorized

OC – retain is not available in ARC

错误提示:’retain’ is unavailable: not available in automatic reference counting

 

1)检查项目是否ARC(一般都是)

target / Build Settings /  搜索Automatic

2)支持ARC和非ARC混合

target / Build Phases / Compile Sources

双击文件,

要支持ARC,写-fobjc-arc

要支持非ARC,写-fno-objc-arc

 

Related posts:

Leave a Reply