Remove dispatch_release when iOS >= 6 || OSX >= 1080
Calling dispatch_release is forbidden under ARC in new iOS and OSX versions.
This preprocessor macro might help:
#define YourDispatchQueueRelease(q) (dispatch_release(q))
#if TARGET_OS_IPHONE
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000
#define YourDispatchQueueRelease(q)
#endif
#else
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
#define YourDispatchQueueRelease(q)
#endif
#endif
References:
https://github.com/ccgus/fmdb/commit/aef763eeb64e6fa654e7d121f1df4c
https://github.com/magicalpanda/MagicalRecord/pull/260
Written by Rod Wilhelmy
Related protips
2 Responses
if you set your deployment target properly, the compiler will do this for you, without having to resort to any of this.
over 1 year ago
·
Yeah, this is quite old. Thanks for the comment!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Arc
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#