Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Objective-C中的强与复制有什么区别?我应该使用哪一个?
我知道如果使用稍后更改自身的可变字符串进行设置,则 copy 会阻止实例变量的值发生更改。还要别的吗?
strong将对象的保留计数器增加 1。
strong
copy使用保留计数器 1 创建对象的副本。
copy
如果使用 ARC,则无法访问保留计数器,但方法与 MRC 相同。