ss
Aeline
2020-09-26 6d8742046f04db48591ace087c35cca0228ae009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//
//  NSMutableDictionary+Utilities.h
//  BUAdSDK
//
//  Created by 李盛 on 2018/2/28.
//  Copyright © 2018年 bytedance. All rights reserved.
//
 
#import <Foundation/Foundation.h>
 
@interface NSDictionary (BU_Helper)
 
- (BOOL)bu_isNull:(id)value;
- (instancetype)bu_objectForKeySafely:(id)aKey;
- (instancetype)bu_valueForKeySafely:(NSString *)key;
- (instancetype)bu_valueForKeyPathSafely:(NSString *)keyPath;
 
#pragma mark - Safe Value Type From Key
- (NSString *)bu_stringForKey:(NSString *)key defaultValue:(NSString *)defalutValue;
- (NSInteger)bu_integerForKey:(NSString *)key defaultValue:(NSInteger)defalutValue;
- (NSTimeInterval)bu_timeIntervalForKey:(NSString *)key defaultValue:(NSTimeInterval)defalutValue;
- (NSArray *)bu_arrayForKey:(NSString *)key defaultValue:(NSArray *)defalutValue;
- (NSDictionary *)bu_dictionaryForKey:(NSString *)key defaultValue:(NSDictionary *)defalutValue;
@end
 
@interface NSDictionary(BU_JSONValue)
 
- (NSString *)bu_JSONRepresentation:(NSError **)error;
+ (id)bu_dictionaryWithJSONData:(NSData *)inData error:(NSError **)outError;
+ (id)bu_dictionaryWithJSONString:(NSString *)inJSON error:(NSError **)outError;
@end