Skip to content

Instantly share code, notes, and snippets.

@colemancda
Last active December 16, 2015 04:49
Show Gist options
  • Save colemancda/5379818 to your computer and use it in GitHub Desktop.
Save colemancda/5379818 to your computer and use it in GitHub Desktop.
Exception for Init - Use when you created a new default inititalizer and dont want anyone to use the '-init' method
- (id)init
{
[NSException raise:@"Wrong initialization method"
format:@"You cannot use %@ with %@, you have to use %@",
NSStringFromSelector(_cmd),
self,
NSStringFromSelector(@selector(<#New Initializer#>))];
return nil;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment