Skip to content

Instantly share code, notes, and snippets.

@johankool
Created February 21, 2012 07:58
Show Gist options
  • Save johankool/1874995 to your computer and use it in GitHub Desktop.
Save johankool/1874995 to your computer and use it in GitHub Desktop.
Useful macros dealing with nil and NSNull
#define NILIFNULL(foo) ((foo == [NSNull null]) ? nil : foo)
#define NULLIFNIL(foo) ((foo == nil) ? [NSNull null] : foo)
#define EMPTYIFNIL(foo) ((foo == nil) ? @"" : foo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment