release method deprecated

后端 未结 3 633
时光说笑
时光说笑 2020-12-12 00:52

When has happen to the release method? I always release a memory allocation when I am done with it and now it seems that the method has been deprecated. Or maybe it does not

相关标签:
3条回答
  • 2020-12-12 01:42

    Automatic Reference Counting (ARC) for Objective-C makes memory management the job of the compiler. By enabling ARC with the new Apple LLVM compiler, you will never need to type retain or release again, dramatically simplifying the development process, while reducing crashes and memory leaks. The compiler has a complete understanding of your objects, and releases each object the instant it is no longer used, so apps run as fast as ever, with predictable, smooth performance.

    - iOS 5 for Developers

    Consider using ARC (Automatic Retain Counting) for your project. There is a refactoring that will convert a current project.

    0 讨论(0)
  • 2020-12-12 01:46

    To manage memory by yourself go to "build settings" and set the flag "Objective-C automatic reference counting" to "No" (it's under "Apple LLVM compiler")

    0 讨论(0)
  • 2020-12-12 01:49

    If you have enabled the 'ARC', then you don't need to release an object. That will be handled by the compiler. retain, release and autorelease are all handled by the compiler.

    Edit: You could know more about that from here

    Also there already a SO thread exists. Please go thru that.

    0 讨论(0)
提交回复
热议问题