Does iOS 5 have garbage collection?

后端 未结 3 1465
故里飘歌
故里飘歌 2020-12-14 08:15

Do I no longer have to worry about memory management iOS 5 onwards? Also, will all programs written for iOS 4 and earlier versions have to be rewritten to allow iOS to manag

3条回答
  •  醉梦人生
    2020-12-14 09:10

    On Apple's public iOS 5 page, they state:

    Automatic Reference Counting

    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.

    It's a compiler feature; not an OS feature so I don't see why it wouldn't work with older versions.

提交回复
热议问题