The background and concepts of the Arc are not described in detail. In short, when using the arc, programmers do not need to care about the object's lifecycle. the compiler will cleverly Add the code during compilation.
Use arc rules:
1. You cannot call methods such as retain, release, auto-relase, and retain count of an object, or indirectly call methods similar to @ selector (retain.
2. The dealloc method of the object cannot be called.
Although the dealloc method of the redefinition class is allowed, the dealloc method of [Super dealloc] or any member variable cannot be called in it, and only some aftercare work is allowed, for example, release some file resources.
3. In the @ property declaration, keywords such as retain, copy, and assign are no longer allowed. They are replaced by two new keywords: strong and weak.
4. When the structure contains object pointers, it is best not to use struct, instead of class, because arc may not be able to recognize the object pointers in struct.
5. You are not allowed to use the NSAID utoreleasepool object. Instead, the @ autoreleasepool {} block is replaced. For example:
Int main (INT argc, char * argv []) {@ autoreleasepool {return uiapplicationmain (argc, argv, nil, nsstringfromclass ([myappdelegate class]);
}}
6. nszone is not allowed to apply for memory space. Nsallocateobject and nsdeallocateobject are not allowed.