Automatically generated code, not garbage collection
Arc judgment criteria:
As long as there is no strong pointer to the object, the object will be released
1. Features of Arc
-Release, retain, and retaincount cannot be called.
-"Dealloc can be rewritten, but [Super dealloc] cannot be called.
-@ PROPERTY PARAMETER
Strong: The member variable is a strong pointer (applicable to the OC object type)
Weak: The member variable is a weak pointer (applicable to OC object types)
Assign: Basic Data Type
-Change the previous retain to strong.Pointers can be divided into two types: strong pointers: by default, all pointers are strong pointers (_ strong can be left blank by default) and two weak underlines: (_ weak) _ weak person * P = [[person alloc] init]; Use Case of weak: circular reference. When a circular reference occurs (a person has a dog and a dog has a master), you must use strong and weak. After the project uses arc, if a file does not want to use arc, in build phases → comlile sources, double-click this file and fill in the pop-up box:
-Fno-objc-ArcIf the project is not an arc, and a file in it wants to use arc, double-click this file in build phases → comlile sources and fill in the pop-up box:
-F-objc-Arc
Objective-C: 08 _ memory management_arc compiler features