How does the new automatic reference counting mechanism work?

后端 未结 6 2119
粉色の甜心
粉色の甜心 2020-11-22 11:08

Can someone briefly explain to me how ARC works? I know it\'s different from Garbage Collection, but I was just wondering exactly how it worked.

Also, if ARC does wh

6条回答
  •  故里飘歌
    2020-11-22 11:50

    It varies greatly from garbage collection. Have you seen the warnings that tell you that you may be leaking objects on different lines? Those statements even tell you on what line you allocated the object. This has been taken a step further and now can insert retain/release statements at the proper locations, better than most programmers, almost 100% of the time. Occasionally there are some weird instances of retained objects that you need to help it out with.

提交回复
热议问题