Jireh程序猿的那些事 Jireh程序猿的那些事

记录分享生活、程序、信息的精彩人生

目录
Property with 'retain(or strong) attribute must be of object type 问题
/  

Property with 'retain(or strong) attribute must be of object type 问题

看原话翻译的理解,在使用 retain 或者 strong 修饰属性时,属性类型必须是对象类型。

然后发现在使用 int、float、double 等,并不能使用 strong 或者 retain 修饰。

所以需要吧 retain 改成 assign。

 @property (retain,nonatomic) NSInteger* mRate;//错误代码

修改后:

@property (assign,nonatomic) NSInteger* mRate;//修改后

如果觉得这篇文章不错的话,请我喝一杯 咖啡☕吧
标题:Property with 'retain(or strong) attribute must be of object type 问题
作者:Jireh
地址:https://jireh.xyz/articles/2020/03/09/1583761546153.html
本作品由 Jireh 采用 署名 – 非商业性使用 – 禁止演绎 4.0 国际许可协议进行许可,转载请注明出处。