If I’m mixing native code with OF, is it OK to simply turn on ARC and assume that OF will work as normal? The ARC example file says that if I turn on ARC, ‘The destructors will be called automatically
when you set your objects to 0.’ Does this mean that any Obj C object I create needs to be manually set to 0 at some point??
ARC only applies to Objective-C objects (NSObject derived), it shouldn’t affect OF code at all.
When working with ARC, you do not have to manually set any objects to 0. Basically, it means you can just write your code and don’t have to worry about releasing objects in 99% of your code. The remaining 1% consists of circular retain cycles and figuring out when to use weak references, but I’d suggest you cross that bridge once you get there.
Thanks, Paul-Jan. That’s very helpful to know and will save me some headache and potentially some crashing. And I don’t think it’s likely I’ll get into any circular retain cycles in this case.