Skip to content

Instantly share code, notes, and snippets.

@tapbots
Created June 12, 2015 18:07
Show Gist options
  • Save tapbots/dca07d5dc59fb556e7f3 to your computer and use it in GitHub Desktop.
Save tapbots/dca07d5dc59fb556e7f3 to your computer and use it in GitHub Desktop.
// Stolen from Tumblr
#define PTH_INVALID_INITIALIZER(initDeclaration) \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wobjc-designated-initializers\"") \
- (instancetype)initDeclaration { \
@throw [[NSException alloc] initWithName:@"Invalid initializer" reason:[NSString stringWithFormat:@"The initializer %s is not available.", __PRETTY_FUNCTION__] userInfo:nil]; \
return nil; \
} \
_Pragma("clang diagnostic pop")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment