From 136b9e58f58cd124cae31f9d0542bd510d98f1e0 Mon Sep 17 00:00:00 2001 From: Uli Kusterer Date: Tue, 21 Feb 2017 15:47:19 +0100 Subject: [PATCH] More efficient version of PROPERTY() macro. Optimizer should eliminate the block, but the @selector() should still cause the compiler to complain if the selector doesn't exist. --- UKHelperMacros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UKHelperMacros.h b/UKHelperMacros.h index 66da50e..ea5fb4e 100644 --- a/UKHelperMacros.h +++ b/UKHelperMacros.h @@ -131,7 +131,7 @@ // (so performance of debug and non-debug builds stays identical). #if DEBUG -#define PROPERTY(propName) (YES ? @ # propName : NSStringFromSelector(@selector(propName))) +#define PROPERTY(propName) ((^{(void)@selector(propName); return nil;})(), @#propName) #else #define PROPERTY(propName) @#propName #endif