NSArray+Category.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // NSArray+Category.h
  3. // 乐销
  4. //
  5. // Created by 隋林栋 on 2017/1/21.
  6. // Copyright © 2017年 ping. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @interface NSArray (Category)
  10. @property (nonatomic, assign, readonly) CGFloat height;//高度,计算views
  11. //@property (nonatomic, readonly) NSString *jsonStr;//获取jsonstr
  12. @property (nonatomic, readonly) NSString *jsonStrCropWPro;//新建产品 json
  13. @property (nonatomic, readonly) NSString *jsonStrCropWCus;//新建客户 json
  14. @property (nonatomic, readonly) NSString *iDStr;
  15. //查询相同的model
  16. - (void)fetchSelectModels:(NSArray *)arySelect compareKey:(NSString *)compareKey exchangeKey:(NSString *)exchangeKey;
  17. //获取选中的数据
  18. - (NSMutableArray *)fetchSelectModelsCompareModel:(id)model keyPath:(NSString *)keyPath;
  19. //获取选中的数据
  20. - (NSMutableArray *)fetchSelectModelsKeyPath:(NSString *)keyPath value:(id)value;
  21. //组成字符串
  22. - (NSString *)componentsJoinedByString:(NSString *)separator keyPath:(NSString *)keyPath;
  23. //组成固定key Json字符串
  24. - (NSString *)fetchJsonkeyPath:(NSString *)keyPath;
  25. //获取keypath 组成的数组
  26. - (NSMutableArray *)fetchValues:(NSString *)keyPath;
  27. //获取元素ary
  28. - (NSMutableArray *)fetchValuesComponentAry:(NSString *)keyPath;
  29. //组成dic
  30. - (NSMutableDictionary *)exchangeDicWithKeyPath:(NSString *)keyPath;
  31. - (NSMutableDictionary *)exchangeStrAryToDic;
  32. //获取相同的model
  33. - (id)fetchSameModelKeyPath:(NSString *)keyPath model:(id)model;
  34. - (NSInteger)fetchSameModelIndexKeyPath:(NSString *)keyPath model:(id)model;
  35. - (NSInteger)fetchSameModelIndexKeyPath:(NSString *)keyPath value:(id)value;
  36. //获取相同的model
  37. - (id)fetchSameModelKeyPath:(NSString *)keyPath value:(id)value;
  38. //获取不同的model
  39. - (NSMutableArray *)fetchDifferentElementKeyPath:(NSString *)keyPath;
  40. //获取相同的model
  41. - (NSMutableArray *)fetchSameElementKeyPath:(NSString *)keyPath aryCompare:(NSArray *)aryCompare;
  42. //转换ary to section
  43. - (NSMutableArray *)exchangeToSectionWithKeyPath:(NSString *)keyPath;
  44. //获取临时固定ary
  45. - (NSArray *)tmpAry;
  46. - (NSMutableArray *)tmpMuAry;
  47. - (NSMutableArray *)copyModelMuAry;
  48. //将model 转换成字典
  49. - (NSMutableArray *)exchangeModelToDicAry;
  50. //写到本地
  51. - (void)writeToLocal:(NSString *)localKey;
  52. //将string 转换成model
  53. - (NSMutableArray *)exhcnageStrAryToModelAry;
  54. //获取model 同一类
  55. - (NSMutableArray * )fetchModelsClassName:(NSString *)className;
  56. #pragma mark logical method
  57. - (NSString *)imageRequestStr;//fetch image request string
  58. - (NSMutableArray *)imageAryOfDic;//fetch ary of dictionary from model
  59. #pragma mark exchange to model
  60. - (NSMutableArray *)exchangeToModel:(NSString *)modelName;
  61. /**
  62. recofig views in the direction vertical
  63. */
  64. - (void)reconfigVerticalViews;
  65. @end