Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'retain' is unavailable error #7

Open
TLHorse opened this issue Apr 10, 2020 · 1 comment
Open

'retain' is unavailable error #7

TLHorse opened this issue Apr 10, 2020 · 1 comment

Comments

@TLHorse
Copy link

TLHorse commented Apr 10, 2020

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'
@HOOKDLL
Copy link

HOOKDLL commented Apr 16, 2021

1.点击项目导航文件--> 选中Targets--> 选择 Build Phases --> 展开Compile Sources
这个时候,我们看到第二列的名称为:Compiler Flags

双击你所要使用ARC的文件,并输入 -fobjc-arc,

那么现在这个文件就可以在编译时使用ARC机制进行编译了。

同上,如果想让使用ARC机制的代码不使用ARC机制,只需要输入 -fno-objc-arc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants