ZKSwizzle
ZKSwizzle copied to clipboard
'retain' is unavailable error
Just build ZKSwizzle.h
and ZKSwizzle.m
, then in ZKSwizzle.m
, at line 293, there're 2 errors:
'retain' is unavailable: not available in automatic reference counting mode
ARC forbids explicit message send of 'retain'
1.点击项目导航文件--> 选中Targets--> 选择 Build Phases --> 展开Compile Sources 这个时候,我们看到第二列的名称为:Compiler Flags
双击你所要使用ARC的文件,并输入 -fobjc-arc,
那么现在这个文件就可以在编译时使用ARC机制进行编译了。
同上,如果想让使用ARC机制的代码不使用ARC机制,只需要输入 -fno-objc-arc