Created
June 4, 2015 10:20
-
-
Save tobihagemann/0cd5ee4a180d289045d8 to your computer and use it in GitHub Desktop.
weakify & strongify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define weakify(var) __weak typeof(var) THWeak_##var = var; | |
#define strongify(var) \ | |
_Pragma("clang diagnostic push") \ | |
_Pragma("clang diagnostic ignored \"-Wshadow\"") \ | |
__strong typeof(var) var = THWeak_##var; \ | |
_Pragma("clang diagnostic pop") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment