Skip to content

Instantly share code, notes, and snippets.

@atomkirk
Forked from JaviSoto/gist:5906004
Last active December 19, 2015 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atomkirk/5909791 to your computer and use it in GitHub Desktop.
Save atomkirk/5909791 to your computer and use it in GitHub Desktop.
#define MSDesignatedInitializer(__SEL__) __attribute__((unavailable("Invoke the designated initializer `" # __SEL__ "` instead.")))
// Sample usage:
- (id)initWithObject:(id)object;
- (id)init MSDesignatedInitializer(initWithObject:); // <- This even gets auto-complete.
// Now calling init on this class would throw a warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment