NSMutableDictionary+Json.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // NSMutableDictionary+Json.h
  3. // CommonLibrary
  4. //
  5. // Created by Alexi on 14-1-16.
  6. // Copyright (c) 2014年 CommonLibrary. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @interface NSMutableDictionary (Json)
  10. - (void)addString:(NSString *)aValue forKey:(id<NSCopying>)aKey;
  11. - (void)addInteger:(NSInteger)aValue forKey:(id<NSCopying>)aKey;
  12. - (void)addCGFloat:(CGFloat)aValue forKey:(id<NSCopying>)aKey;
  13. - (void)addBOOL:(BOOL)aValue forKey:(id<NSCopying>)aKey;
  14. - (void)addBOOLStr:(BOOL)aValue forKey:(id<NSCopying>)aKey;
  15. - (void)addNumber:(NSNumber *)aValue forKey:(id<NSCopying>)aKey;
  16. - (void)addArray:(NSArray *)aValue forKey:(id<NSCopying>)aKey;
  17. - (NSString *)convertToJSONString;
  18. //- (id)jsonObjectForKey:(id<NSCopying>)key;
  19. @end
  20. @interface NSDictionary (Json)
  21. //- (id)jsonObjectForKey:(id<NSCopying>)key;
  22. - (NSMutableDictionary *)dictionaryForKey:(id<NSCopying>)key;
  23. - (NSString *)stringForKey:(id<NSCopying>)key;
  24. - (NSInteger)integerForKey:(id<NSCopying>)key;
  25. - (BOOL)boolForKey:(id<NSCopying>)key;
  26. - (CGFloat)floatForKey:(id<NSCopying>)key;
  27. - (double)doubleForKey:(id<NSCopying>)key;
  28. - (NSMutableArray *)arrayForKey:(id<NSCopying>)key;
  29. @end