Skip to content

Instantly share code, notes, and snippets.

@itsthejb
Last active August 29, 2015 13:56
Show Gist options
  • Save itsthejb/8902125 to your computer and use it in GitHub Desktop.
Save itsthejb/8902125 to your computer and use it in GitHub Desktop.
Macro to suppress performSelector leak warning while executing an arbitrary block. Can yield a value.
#define SuppressPerformSelectorLeakWarningForExpression(expression) ({ \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Warc-performSelector-leaks\"") \
expression; \
_Pragma("clang diagnostic pop") })
@itsthejb
Copy link
Author

id value = SuppressPerformSelectorLeakWarningForExpression([object performSelector:sel])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment