How would I do this? At the moment, the compiler complains that
"'objc_collectingEnabled()' was not declared in this scope." Compiling as with the extension .m fixes this, but then I can’t call from another C++ library that I need to use.
Current code:
- (void)functionName
{
if(!objc_collectingEnabled())
{
free(x);
}
}
Have you tried
#include <objc/objc-auto.h>? That’s where the function is declared.