Skip to content

Instantly share code, notes, and snippets.

@streeter
Created July 19, 2013 22:14
Show Gist options
  • Save streeter/6042730 to your computer and use it in GitHub Desktop.
Save streeter/6042730 to your computer and use it in GitHub Desktop.
Bless and designate certain initializers as the proper initializer to use.
// Bless a certain initializer at compile time
//
// Sample usage:
// - (instancetype)initWithObject:(id)object
// - (instancetype)init ECDesignatedInitializer(initWithObject:);
//
#define ECDesignatedInitializer(__SEL__) __attribute__((unavailable("Invoke the designated initializer `" # __SEL__ "` instead.")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment