Last active
December 11, 2015 22:28
-
-
Save nielsbot/4669657 to your computer and use it in GitHub Desktop.
Tired of dealing with NSNull in your KVO observers? I use this.
This file contains hidden or 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
@implementation NSNull (IfNullThenNil) | |
-(id)ifNullThenNil { return nil ; } | |
@end | |
@implementation NSObject (IfNullThenNil) | |
-(id)ifNullThenNil { return self ; } | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment