2

Here is what I am not sure about:

I have a c++ class that will create and own an obj-C object and very simply, when that C++ class is constructed I call:

this->objCObject = [ThatObject new];

But how do I deal with destroying the ObjC object in ~MyCPPClass() ? Under ARC there is no retain/release.

Thanks

jmasterx
  • 52,639
  • 96
  • 311
  • 557

1 Answers1

0

You could disable ARC for the specific file that contains your CPP class. That will give you the freedom to use retain/release in your CPP class.

If you have multiple cases that need the same trick, you could look at the shared_ptr for Objective-C objects

Community
  • 1
  • 1
tofi9
  • 5,775
  • 4
  • 29
  • 50