NSMutableDictionary+Json.h
1.15 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// NSMutableDictionary+Json.h
// CommonLibrary
//
// Created by Alexi on 14-1-16.
// Copyright (c) 2014年 CommonLibrary. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSMutableDictionary (Json)
- (void)addString:(NSString *)aValue forKey:(id<NSCopying>)aKey;
- (void)addInteger:(NSInteger)aValue forKey:(id<NSCopying>)aKey;
- (void)addCGFloat:(CGFloat)aValue forKey:(id<NSCopying>)aKey;
- (void)addBOOL:(BOOL)aValue forKey:(id<NSCopying>)aKey;
- (void)addBOOLStr:(BOOL)aValue forKey:(id<NSCopying>)aKey;
- (void)addNumber:(NSNumber *)aValue forKey:(id<NSCopying>)aKey;
- (void)addArray:(NSArray *)aValue forKey:(id<NSCopying>)aKey;
- (NSString *)convertToJSONString;
//- (id)jsonObjectForKey:(id<NSCopying>)key;
@end
@interface NSDictionary (Json)
//- (id)jsonObjectForKey:(id<NSCopying>)key;
- (NSMutableDictionary *)dictionaryForKey:(id<NSCopying>)key;
- (NSString *)stringForKey:(id<NSCopying>)key;
- (NSInteger)integerForKey:(id<NSCopying>)key;
- (BOOL)boolForKey:(id<NSCopying>)key;
- (CGFloat)floatForKey:(id<NSCopying>)key;
- (double)doubleForKey:(id<NSCopying>)key;
- (NSMutableArray *)arrayForKey:(id<NSCopying>)key;
@end