What is the difference between Objective-C automatic reference counting and garbage collection?

后端 未结 4 574
[愿得一人]
[愿得一人] 2020-11-27 11:44

With the new automatic reference counting (ARC) introduced in Xcode 4.2, we no longer need to manually manage retain / release in Objective-C.

This seems similar to

4条回答
  •  爱一瞬间的悲伤
    2020-11-27 12:04

    the short and sweet answer is as follow:

    GC of java is Runtime, while ARC is compile time.

    GC has reference to the objects at runtime and check for the dependencies of object runtime. While ARC appends the release, retain, autorelease calls at compiletime.

提交回复
热议问题