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

关联BOOL类型和CGFloat类型的属性时 改用OBJC_ASSOCIATION_ASSIGN #185

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

coderChrisLee
Copy link

简单的值类型改用 OBJC_ASSOCIATION_ASSIGN。

@sinno93
Copy link

sinno93 commented Oct 10, 2018

coderChrisLee你好!
关联只能关联对象,要想关联BOOL、CGFloat需要封装成对象,比如此处封装成了NSNumber类型,所以用OBJC_ASSOCIATION_RETAIN_NONATOMIC没问题;
如果改为OBJC_ASSOCIATION_ASSIGN ,如果关联的对象释放后再访问有可能造成crash。

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

Successfully merging this pull request may close these issues.

2 participants