So far Objective-C developers can have several methods to manage memory, the most common one is [object dealloc].
MRC: Each time [object retain] is referenced, the reference count will be +1, and [object release] will be used to prevent accidental release and wild pointers.
GC: This is only supported by Cocoa. NSGarbageCollector can implement automatic garbage collection similar to Java. The disadvantage is that it affects performance, so Cocoa Touch does not provide this function.
ARC: This is a new feature (not actually new). Xcode’s new default compiler, Apple LLVM, replaces the previous LLVM-GCC and uses Clang as the front end. Clang comes with a static analyzer, which performs compilation before the code is compiled. It will be analyzed, and where retain and release need to be added, the analyzer will complete them on your behalf. ARC can take over a large number of manual reference counting operations and avoid many mistakes. After using ARC, it is forbidden to manually use the retain and release methods. You can overload dealloc but only implement customized releases.
I have been researching this recently. Please correct me if there are any mistakes
2.0
2.0 adds GC
Are you actually looking for an article here? "The Story Behind Mac OS X (8) LLVM Compilation Toolchain by Three Good Students Chris Lattner"
From iOS 5. Xcode 4.2.
So far Objective-C developers can have several methods to manage memory, the most common one is [object dealloc].
MRC: Each time [object retain] is referenced, the reference count will be +1, and [object release] will be used to prevent accidental release and wild pointers.
GC: This is only supported by Cocoa. NSGarbageCollector can implement automatic garbage collection similar to Java. The disadvantage is that it affects performance, so Cocoa Touch does not provide this function.
ARC: This is a new feature (not actually new). Xcode’s new default compiler, Apple LLVM, replaces the previous LLVM-GCC and uses Clang as the front end. Clang comes with a static analyzer, which performs compilation before the code is compiled. It will be analyzed, and where retain and release need to be added, the analyzer will complete them on your behalf. ARC can take over a large number of manual reference counting operations and avoid many mistakes. After using ARC, it is forbidden to manually use the retain and release methods. You can overload dealloc but only implement customized releases.
I have been researching this recently. Please correct me if there are any mistakes