Strong vs. Conservation in ARC

I know that there have been many writings about the "strong" and the "weak." But all the documents say that both are 100% synonymous with each other, and you can use the "strong" instead of the "save" and vice versa.

My question is: if they are the same, why did Apple introduce a new “strong” keyword? I tested both in the project example, and both the strong and save attributes of the properties seem to do the same. Don't you think that if Apple introduces a “strong” attribute, it should ban the use of the “save” attribute? Or am I missing something?

+6
source share
1 answer

retain is the remainder of the days before the ARC when you increased / decreased retain count objects depending on whether you want it to hang in memory.

Obviously, with ARC, you no longer need to worry about this, and I suspect that retain can just be left for ease of use for more experienced objective-c programmers there.

The keywords most common with the arc are: (strong, weak, nonatomic, readonly, copy) .

+9
source

Source: https://habr.com/ru/post/983260/


All Articles