简体   繁体   English

宣布财产的理由为(强,强)

[英]Reason for declaring a property as (strong, strong)

I just got a large chunk of code that someone else have written. 我刚刚收到了其他人编写的大量代码。 First I dismissed it as a typo but then noticed it in several other places as well. 首先,我将其视为拼写错误,然后在其他几个地方也注意到了它。

The essentials is that the other programmer (not sure of his "skill level") declared some properties as 要点是另一个程序员(不确定他的“技能水平”)宣称某些属性为

@property (strong, strong) NSObject *anObject;

The compiler does not complain so I was wondering if there is any reason for doing this or should I consider them all to be "typos"? 编译器没有抱怨所以我想知道是否有任何理由这样做或者我应该认为它们都是“错别字”?

(The project uses ARC) (该项目使用ARC)

我觉得这样做没有任何意义,我很惊讶编译器没有抱怨这一点。

I think the developer miswrote it. 我认为开发人员误解了它。 Strong keyword increases the retain count by 1 so by 2 strongs maybe the dev thought to increase retain count by 2.. 强关键字会将保留计数增加1,因此2个强者可能会认为将保留计数增加2。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM