From 1b3cf4d8b5689b30786d80b06e1616a9adb3644f Mon Sep 17 00:00:00 2001 From: Andrew Toulouse Date: Mon, 22 Sep 2014 21:55:35 -0700 Subject: [PATCH] Annotate -didLoad with an attribute (if supported) that will flag missing didLoad calls --- AsyncDisplayKit/ASDisplayNode+Subclasses.h | 2 +- Base/ASBaseDefines.h | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/AsyncDisplayKit/ASDisplayNode+Subclasses.h b/AsyncDisplayKit/ASDisplayNode+Subclasses.h index 290d1ff7c6..eb4720ceee 100644 --- a/AsyncDisplayKit/ASDisplayNode+Subclasses.h +++ b/AsyncDisplayKit/ASDisplayNode+Subclasses.h @@ -74,7 +74,7 @@ * * @discussion This is the best time to add gesture recognizers to the view. */ -- (void)didLoad; +- (void)didLoad ASDISPLAYNODE_REQUIRES_SUPER; /** @name Layout */ diff --git a/Base/ASBaseDefines.h b/Base/ASBaseDefines.h index 1beeca05fe..dcf9dbe825 100755 --- a/Base/ASBaseDefines.h +++ b/Base/ASBaseDefines.h @@ -90,6 +90,10 @@ #define __has_feature(x) 0 // Compatibility with non-clang compilers. #endif +#ifndef __has_attribute // Optional. +#define __has_attribute(x) 0 // Compatibility with non-clang compilers. +#endif + #ifndef NS_CONSUMED #if __has_feature(attribute_ns_consumed) #define NS_CONSUMED __attribute__((ns_consumed)) @@ -129,3 +133,11 @@ // http://gcc.gnu.org/onlinedocs/cpp/Stringification.html #define ASDISPLAYNODE_TO_STRING(str) #str #define ASDISPLAYNODE_TO_UNICODE_STRING(str) @ASDISPLAYNODE_TO_STRING(str) + +#ifndef ASDISPLAYNODE_REQUIRES_SUPER +#if __has_attribute(objc_requires_super) +#define ASDISPLAYNODE_REQUIRES_SUPER __attribute__((objc_requires_super)) +#else +#define ASDISPLAYNODE_REQUIRES_SUPER +#endif +#endif