IOS, ARC, Property: (readwrite, nonatomic) vs (radwrite, retain, nonatomic)

后端 未结 2 1736
一生所求
一生所求 2020-12-20 10:07

I am have read up some tutorials on ARC and am still left a bit confused on properties declarations. I wrote most most my code using the following pattern:

@         


        
2条回答
  •  既然无缘
    2020-12-20 10:32

    If you prefer continue to use your code, you can exclude ARC only on the specific file .m you want:

    Go to Targets > Build Phases > Compile Sources and select your .m file double click on right column of the selection and add -fno-objc-arc so you are exclude ARC only a selected file.

    Or if you want to convert all application to new code with ARC, after make a Backup of you project, go to:

    Edit > Refactor > Convert to Objective-C ARC and after this do the same but click on Convert to modern Objective-C Sintax

    here the screen:

    enter image description here Pay attention not always working before to try duplicate your project!

    Hope this help you

提交回复
热议问题