Skip to content

Instantly share code, notes, and snippets.

@abbeyjackson
Created November 13, 2015 22:04
Show Gist options
  • Save abbeyjackson/c1bbbffb07f5578d250b to your computer and use it in GitHub Desktop.
Save abbeyjackson/c1bbbffb07f5578d250b to your computer and use it in GitHub Desktop.
How to make methods unavailable, make compiler warnings / errors using #define statements
#define __SXMWebAction__UnavailableConstructor__(x) __attribute__((unavailable("This class must be instantiated using '"x"WithJSON:' or '"x"WithHTMLJSON:'")))
#pragma mark - Unavailable Super Methods
- (id)init __SXMWebAction__UnavailableConstructor__("init");
+ (id)new __SXMWebAction__UnavailableConstructor__("webAction");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment