开启了ARC的objective-C++代码中C++对象是否需要手动释放?
PHPz
PHPz 2017-04-17 11:45:05
0
1
566

开启了ARC的objective-C++代码中C++对象是否需要手动释放?

PHPz
PHPz

学习是最好的投资!

reply all(1)
巴扎黑

Required. ARC is just a compiler technology that automatically inserts retain/release by scanning the code. C++ code is not within the scope of recognition by the compiler, and the life cycle can only be managed by itself.

In addition, ARC technology is a "backward" technology that has to be used because the Obj-C language itself cannot implement automatic reference counting. For C++, you can directly use the smart pointer classes provided by the standard library such as shared_ptr/unique_ptr/weak_ptr. Able to write code as clean as ARC. In a sense, using smart pointers, C++ objects do not need to be released manually.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template