Skip to content

Instantly share code, notes, and snippets.

@seivan
Forked from JaviSoto/gist:5906004
Created July 2, 2013 09:15
Show Gist options
  • Select an option

  • Save seivan/5907870 to your computer and use it in GitHub Desktop.

Select an option

Save seivan/5907870 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