Created
February 21, 2012 07:58
-
-
Save johankool/1874995 to your computer and use it in GitHub Desktop.
Useful macros dealing with nil and NSNull
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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