As LLVM compiler with ARC option add retain, copy,release and autorelease for us automatically, but how does ARC determine whether to use retain or copy? Thanks in advance:)
2
votes
2 Answers
4
votes
0
votes
As mentioned in following docs (http://clang.llvm.org/docs/AutomaticReferenceCounting.html#meta)
Automatic Reference Counting implements automatic memory management for Objective-C objects and blocks, freeing the programmer from the need to explicitly insert retains and releases. It does not provide a cycle collector; users must explicitly manage the lifetime of their objects, breaking cycles manually or with weak or unsafe references.
Also you can go through the discussion of this thread - How does the new automatic reference counting mechanism work?