口袋优选

JsonTool.h 569B

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // JsonTool.h
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/11/5.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. @interface JsonTool : NSObject
  11. /**
  12. 字典转json字符串
  13. */
  14. + (NSString *)convertToJsonData:(NSDictionary *)dict;
  15. /**
  16. json转数组
  17. */
  18. + (NSArray *)stringToJSON:(NSString *)jsonStr;
  19. /**
  20. json转字典
  21. */
  22. + (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;
  23. /**
  24. 数组转json
  25. */
  26. + (NSString *)arrayToJSONString:(NSArray *)arr;
  27. @end
  28. NS_ASSUME_NONNULL_END