Created
April 15, 2015 07:45
-
-
Save steipete/2b352af0fef03d35d84f to your computer and use it in GitHub Desktop.
This file contains hidden or 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 PSPDF_NOT_DESIGNATED_INITIALIZER() PSPDF_NOT_DESIGNATED_INITIALIZER_CUSTOM(init) | |
#define PSPDF_NOT_DESIGNATED_INITIALIZER_CUSTOM(initName) \ | |
_Pragma("clang diagnostic push") \ | |
_Pragma("clang diagnostic ignored \"-Wobjc-designated-initializers\"") \ | |
- (instancetype)initName \ | |
{ do { \ | |
NSAssert2(NO, @"%@ is not the designated initializer for instances of %@.", NSStringFromSelector(_cmd), NSStringFromClass([self class])); \ | |
return nil; \ | |
} while (0); } \ | |
_Pragma("clang diagnostic pop") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@steipete it seems that the
do { } while (0);
wrapper is unnecessary.