Skip to content

Instantly share code, notes, and snippets.

@amattn
Created March 6, 2011 19:47
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 amattn/857584 to your computer and use it in GitHub Desktop.
Save amattn/857584 to your computer and use it in GitHub Desktop.
Objective C Macro of the week: ASSERT_NIL // used to guarantee that a given object is nil.
#define ASSERT_NIL(x) NSAssert4((x == nil), @"\n\n **** Unexpected Nil Assertion ****\n **** Expected nil, but " #x @" is not nil.\nin file:%s at line %i in Method %@ with object:\n %@", __FILE__, __LINE__, NSStringFromSelector(_cmd), self)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment