Last active
December 17, 2015 20:58
-
-
Save gin0606/5670915 to your computer and use it in GitHub Desktop.
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
// | |
// Created by kkgn06 on 2013/05/29. | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSDictionary (KKWithoutNSNull) | |
-(id)objectOrNilForKey:(id)key; | |
@end |
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
// | |
// Created by kkgn06 on 2013/05/29. | |
// | |
#import "NSDictionary+KKWithoutNSNull.h" | |
@implementation NSDictionary (KKWithoutNSNull) | |
- (id)objectOrNilForKey:(id)key { | |
id o = [self objectForKey:key]; | |
if ([o isEqual:[NSNull null]]) { | |
return nil; | |
} | |
return o; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment