RAUtils.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // RAUtils.h
  3. // RedAnt ERP Mobile
  4. //
  5. // Created by Ray on 9/17/15.
  6. // Copyright (c) 2015 United Software Applications, Inc. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. //typedef struct {
  10. //
  11. // NSString* id;
  12. //
  13. // float height;
  14. //
  15. //
  16. //}MyTestStruct;
  17. typedef void (^add_to_cart_Handler)(void);
  18. @interface RAUtils : NSObject
  19. +(NSString*) FloatFormat:(float)value;
  20. +(UIViewController*) getViewController:(UIView*) view;
  21. + (CGRect)relativeFrameForScreenWithView:(UIView *)v;
  22. +(NSDictionary*) error_json :(int)code err_msg:(NSString*)msg;
  23. +(void) message_alert :(NSString*) msg title:(NSString*) title controller:(UIViewController*) vc;
  24. +(void) alert_view :(NSString*) msg title:(NSString*) title ;
  25. +(UIAlertView * ) waiting_alert :(NSString*) msg title:(NSString*) title;
  26. + (float)fileSizeForDir:(NSString*)path;//计算文件夹下文件的总大小;
  27. +(void) deletefiles :(NSString*) path;
  28. +(UIColor*) strColor:(NSString*) color;
  29. +(NSDictionary*) string2dict:(NSString*) str;
  30. +(NSString*) dict2string:(NSDictionary*) dict;
  31. +(NSString*) arr2string:(NSArray *) arr separator:(NSString*)separator trim:(bool) btrim;
  32. +(NSString*) base64en:(NSString*) string;
  33. +(NSString*) base64de:(NSString*) string;
  34. +(NSDictionary*) device_info;
  35. +(NSDictionary*) error_dict:(NSError*)error;
  36. + (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size;
  37. +(UIImage*)img_compress:(UIImage*)image kbsize:(float) size;
  38. +(NSString* )current_date;
  39. +(NSMutableArray*)dictionary2array:(NSDictionary*)json count_fields:(NSString*) count_fields item_mark:(NSString*) item_mark items_mark:(NSString* )items_mark;
  40. +(void) add_recent_model:(NSDictionary*) model;
  41. + (long long) freeDiskSpaceInMegaBytes;
  42. +(NSArray*) string2arr:(NSString*) string separator:(NSString*)separator;
  43. +(void) add_to_cart:(UIViewController*) vc selectorholder:(id)holder selector:(SEL)addtocart;
  44. @end