Skip to content

Instantly share code, notes, and snippets.

@lukeredpath
Created August 5, 2011 12:46
Show Gist options
  • Save lukeredpath/1127470 to your computer and use it in GitHub Desktop.
Save lukeredpath/1127470 to your computer and use it in GitHub Desktop.
maybenull.h
#define maybeNull(obj) ([[NSNull null] isEqual:obj] ? nil : obj)
// [maybeNull(someObject) doSomething] => [nil doSomething] if null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment