magicalpanda/MagicalRecord — Issue #89: Non ARC on iOS 5 problem - NS_AUTOMATED_REFCOUNT_UNAVAILABLE
Author: nick671
Created: 2011-11-28 09:47:28+00:00
State: open

Hello,

It seems that the tests with NS_AUTOMATED_REFCOUNT_UNAVAILABLE are irrelevant, because this macro is always defined.
From NSObjcCRuntime.h :

// Marks methods and functions which cannot be used when compiling in automatic reference counting mode.
#if __has_feature(objc_arc)
#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))
#else
#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE
#endif

Wouldn't It be better to test #if __has_feature(objc_arc) ?

I use MagicalRecord with iOS 5 sdk, without ARC, and I had random crashes because of this.

Thanks